Add 128-bit integer support to de::IgnoredAny

This fixes the errors that occur when IgnoredAny is deserialized
from anything containing a 128-bit integer somewhere. As IgnoredAny
is used in serde_derive to skip ignored fields in structs, these
errors currently prevent parsing of structs with an ignored field
containing a 128-bit integer in the serialization.
This commit is contained in:
Leo Blöcher 2021-01-19 02:32:26 +01:00 committed by GitHub
parent 78a9dbc57e
commit c162d51866
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -130,12 +130,28 @@ impl<'de> Visitor<'de> for IgnoredAny {
Ok(IgnoredAny)
}
serde_if_integer128! {
#[inline]
fn visit_i128<E>(self, x: i128) -> Result<Self::Value, E> {
let _ = x;
Ok(IgnoredAny)
}
}
#[inline]
fn visit_u64<E>(self, x: u64) -> Result<Self::Value, E> {
let _ = x;
Ok(IgnoredAny)
}
serde_if_integer128! {
#[inline]
fn visit_u128<E>(self, x: u128) -> Result<Self::Value, E> {
let _ = x;
Ok(IgnoredAny)
}
}
#[inline]
fn visit_f64<E>(self, x: f64) -> Result<Self::Value, E> {
let _ = x;