Skip to content

Commit

Permalink
Add 128-bit integer support to de::IgnoredAny
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
TheJokr committed Jan 19, 2021
1 parent 78a9dbc commit c162d51
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions serde/src/de/ignored_any.rs
Expand Up @@ -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;
Expand Down

0 comments on commit c162d51

Please sign in to comment.