Skip to content

Commit

Permalink
Allow to deserialize newtype structs from SeqAccessDeserializer
Browse files Browse the repository at this point in the history
  • Loading branch information
Mingun committed Aug 24, 2024
1 parent 35b9d13 commit c22590d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion serde/src/de/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1102,9 +1102,16 @@ where
self.deserialize_unit(visitor)
}

fn deserialize_newtype_struct<V>(self, _name: &str, visitor: V) -> Result<V::Value, Self::Error>
where
V: de::Visitor<'de>,
{
visitor.visit_newtype_struct(self)
}

forward_to_deserialize_any! {
bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string
bytes byte_buf option newtype_struct seq tuple
bytes byte_buf option seq tuple
tuple_struct map struct enum identifier ignored_any
}
}
Expand Down

0 comments on commit c22590d

Please sign in to comment.