diff --git a/src/value/de.rs b/src/value/de.rs index c38253aff..3973ae794 100644 --- a/src/value/de.rs +++ b/src/value/de.rs @@ -44,9 +44,12 @@ impl<'de> Deserialize<'de> for Value { Ok(Value::Number(value.into())) } - #[inline] - fn visit_i128(self, value: i128) -> Result { - Ok(Number::from_i128(value).map_or(Value::Null, Value::Number)) + fn visit_i128(self, value: i128) -> Result + where + E: serde::de::Error, + { + let de = serde::de::value::I128Deserializer::new(value); + Number::deserialize(de).map(Value::Number) } #[inline]