Fix only_i32 build.

This commit is contained in:
Stephen Chung 2022-11-23 18:46:40 +08:00
parent 46514bbc85
commit a8f12cb212
2 changed files with 2 additions and 2 deletions

View File

@ -94,7 +94,7 @@ impl<'de> Visitor<'de> for DynamicVisitor {
return Ok(Dynamic::from(v as INT));
#[cfg(feature = "only_i32")]
if v <= INT::MAX as i32 {
if v <= INT::MAX as u32 {
return Ok(Dynamic::from(v as INT));
}

View File

@ -189,7 +189,7 @@ impl Serializer for &mut DynamicSerializer {
return Ok(Dynamic::from(v as INT));
#[cfg(feature = "only_i32")]
if v <= INT::MAX as i32 {
if v <= INT::MAX as u32 {
return Ok(Dynamic::from(v as INT));
}