From f6673dfdb3f93bacfbf0c0cab4d78bc4154eec0c Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 6 Jul 2017 11:43:36 -0700 Subject: One more case of handling newtype structs --- src/de.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/de.rs b/src/de.rs index 77b5ee5..9ff09f7 100644 --- a/src/de.rs +++ b/src/de.rs @@ -438,9 +438,19 @@ impl<'de, 'b> de::Deserializer<'de> for MapVisitor<'de, 'b> { visitor.visit_some(self) } + fn deserialize_newtype_struct( + self, + _name: &'static str, + visitor: V + ) -> Result + where V: de::Visitor<'de> + { + visitor.visit_newtype_struct(self) + } + forward_to_deserialize_any! { bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string seq - bytes byte_buf map struct unit newtype_struct identifier + bytes byte_buf map struct unit identifier ignored_any unit_struct tuple_struct tuple enum } } -- cgit v1.2.3