From 5b118fdef425e3602a86f2ddead678540a191d84 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Fri, 14 Apr 2017 15:24:21 -0700 Subject: [PATCH] Reorder methods to match the serializer trait --- serde/src/de/impls.rs | 8 +- serde/src/de/mod.rs | 162 ++++++++++++++++++++-------------------- serde/src/de/value.rs | 66 ++++++++-------- serde/src/macros.rs | 70 ++++++++--------- serde/src/private/de.rs | 42 +++++------ serde_test/src/de.rs | 10 +-- 6 files changed, 181 insertions(+), 177 deletions(-) diff --git a/serde/src/de/impls.rs b/serde/src/de/impls.rs index 2b8cbb66..ad481bdf 100644 --- a/serde/src/de/impls.rs +++ b/serde/src/de/impls.rs @@ -130,32 +130,36 @@ macro_rules! impl_deserialize_num { } } }; + (integer $ty:ident) => { visit_integer_method!(i8, visit_i8, from_i8, Signed, i64); visit_integer_method!(i16, visit_i16, from_i16, Signed, i64); visit_integer_method!(i32, visit_i32, from_i32, Signed, i64); visit_integer_method!(i64, visit_i64, from_i64, Signed, i64); + visit_integer_method!(u8, visit_u8, from_u8, Unsigned, u64); visit_integer_method!(u16, visit_u16, from_u16, Unsigned, u64); visit_integer_method!(u32, visit_u32, from_u32, Unsigned, u64); visit_integer_method!(u64, visit_u64, from_u64, Unsigned, u64); }; + (float $ty:ident) => { visit_float_method!(f32, visit_f32); visit_float_method!(f64, visit_f64); }; } -impl_deserialize_num!(isize, deserialize_i64, integer); impl_deserialize_num!(i8, deserialize_i8, integer); impl_deserialize_num!(i16, deserialize_i16, integer); impl_deserialize_num!(i32, deserialize_i32, integer); impl_deserialize_num!(i64, deserialize_i64, integer); -impl_deserialize_num!(usize, deserialize_u64, integer); +impl_deserialize_num!(isize, deserialize_i64, integer); + impl_deserialize_num!(u8, deserialize_u8, integer); impl_deserialize_num!(u16, deserialize_u16, integer); impl_deserialize_num!(u32, deserialize_u32, integer); impl_deserialize_num!(u64, deserialize_u64, integer); +impl_deserialize_num!(usize, deserialize_u64, integer); impl_deserialize_num!(f32, deserialize_f32, integer, float); impl_deserialize_num!(f64, deserialize_f64, integer, float); diff --git a/serde/src/de/mod.rs b/serde/src/de/mod.rs index 74fb629e..a8275ef6 100644 --- a/serde/src/de/mod.rs +++ b/serde/src/de/mod.rs @@ -804,26 +804,6 @@ pub trait Deserializer<'de>: Sized { where V: Visitor<'de>; - /// Hint that the `Deserialize` type is expecting a `u8` value. - fn deserialize_u8(self, visitor: V) -> Result - where - V: Visitor<'de>; - - /// Hint that the `Deserialize` type is expecting a `u16` value. - fn deserialize_u16(self, visitor: V) -> Result - where - V: Visitor<'de>; - - /// Hint that the `Deserialize` type is expecting a `u32` value. - fn deserialize_u32(self, visitor: V) -> Result - where - V: Visitor<'de>; - - /// Hint that the `Deserialize` type is expecting a `u64` value. - fn deserialize_u64(self, visitor: V) -> Result - where - V: Visitor<'de>; - /// Hint that the `Deserialize` type is expecting an `i8` value. fn deserialize_i8(self, visitor: V) -> Result where @@ -844,6 +824,26 @@ pub trait Deserializer<'de>: Sized { where V: Visitor<'de>; + /// Hint that the `Deserialize` type is expecting a `u8` value. + fn deserialize_u8(self, visitor: V) -> Result + where + V: Visitor<'de>; + + /// Hint that the `Deserialize` type is expecting a `u16` value. + fn deserialize_u16(self, visitor: V) -> Result + where + V: Visitor<'de>; + + /// Hint that the `Deserialize` type is expecting a `u32` value. + fn deserialize_u32(self, visitor: V) -> Result + where + V: Visitor<'de>; + + /// Hint that the `Deserialize` type is expecting a `u64` value. + fn deserialize_u64(self, visitor: V) -> Result + where + V: Visitor<'de>; + /// Hint that the `Deserialize` type is expecting a `f32` value. fn deserialize_f32(self, visitor: V) -> Result where @@ -1225,67 +1225,6 @@ pub trait Visitor<'de>: Sized { self.visit_str(&v) } - /// Deserialize a `()` into a `Value`. - fn visit_unit(self) -> Result - where - E: Error, - { - Err(Error::invalid_type(Unexpected::Unit, &self)) - } - - /// Deserialize an absent optional `Value`. - fn visit_none(self) -> Result - where - E: Error, - { - Err(Error::invalid_type(Unexpected::Option, &self)) - } - - /// Deserialize a present optional `Value`. - fn visit_some(self, deserializer: D) -> Result - where - D: Deserializer<'de>, - { - let _ = deserializer; - Err(Error::invalid_type(Unexpected::Option, &self)) - } - - /// Deserialize `Value` as a newtype struct. - fn visit_newtype_struct(self, deserializer: D) -> Result - where - D: Deserializer<'de>, - { - let _ = deserializer; - Err(Error::invalid_type(Unexpected::NewtypeStruct, &self)) - } - - /// Deserialize `Value` as a sequence of elements. - fn visit_seq(self, seq: A) -> Result - where - A: SeqAccess<'de>, - { - let _ = seq; - Err(Error::invalid_type(Unexpected::Seq, &self)) - } - - /// Deserialize `Value` as a key-value map. - fn visit_map(self, map: A) -> Result - where - A: MapAccess<'de>, - { - let _ = map; - Err(Error::invalid_type(Unexpected::Map, &self)) - } - - /// Deserialize `Value` as an enum. - fn visit_enum(self, data: A) -> Result - where - A: EnumAccess<'de>, - { - let _ = data; - Err(Error::invalid_type(Unexpected::Enum, &self)) - } - /// Deserialize a `&[u8]` into a `Value`. /// /// This method allows the `Deserializer` to avoid a copy by retaining @@ -1341,6 +1280,67 @@ pub trait Visitor<'de>: Sized { { self.visit_bytes(&v) } + + /// Deserialize an absent optional `Value`. + fn visit_none(self) -> Result + where + E: Error, + { + Err(Error::invalid_type(Unexpected::Option, &self)) + } + + /// Deserialize a present optional `Value`. + fn visit_some(self, deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let _ = deserializer; + Err(Error::invalid_type(Unexpected::Option, &self)) + } + + /// Deserialize a `()` into a `Value`. + fn visit_unit(self) -> Result + where + E: Error, + { + Err(Error::invalid_type(Unexpected::Unit, &self)) + } + + /// Deserialize `Value` as a newtype struct. + fn visit_newtype_struct(self, deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let _ = deserializer; + Err(Error::invalid_type(Unexpected::NewtypeStruct, &self)) + } + + /// Deserialize `Value` as a sequence of elements. + fn visit_seq(self, seq: A) -> Result + where + A: SeqAccess<'de>, + { + let _ = seq; + Err(Error::invalid_type(Unexpected::Seq, &self)) + } + + /// Deserialize `Value` as a key-value map. + fn visit_map(self, map: A) -> Result + where + A: MapAccess<'de>, + { + let _ = map; + Err(Error::invalid_type(Unexpected::Map, &self)) + } + + /// Deserialize `Value` as an enum. + fn visit_enum(self, data: A) -> Result + where + A: EnumAccess<'de>, + { + let _ = data; + Err(Error::invalid_type(Unexpected::Enum, &self)) + } } //////////////////////////////////////////////////////////////////////////////// diff --git a/serde/src/de/value.rs b/serde/src/de/value.rs index 29c8bcdb..8cf9e028 100644 --- a/serde/src/de/value.rs +++ b/serde/src/de/value.rs @@ -129,9 +129,9 @@ where type Error = E; forward_to_deserialize_any! { - bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit seq - seq_fixed_size bytes map unit_struct newtype_struct tuple_struct struct - identifier tuple enum ignored_any byte_buf + bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes + byte_buf unit unit_struct newtype_struct seq seq_fixed_size tuple + tuple_struct map struct identifier enum ignored_any } fn deserialize_any(self, visitor: V) -> Result @@ -182,9 +182,9 @@ macro_rules! primitive_deserializer { type Error = E; forward_to_deserialize_any! { - bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit - option seq seq_fixed_size bytes map unit_struct newtype_struct - tuple_struct struct identifier tuple enum ignored_any byte_buf + bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes + byte_buf option unit unit_struct newtype_struct seq seq_fixed_size + tuple tuple_struct map struct identifier enum ignored_any } fn deserialize_any(self, visitor: V) -> Result @@ -239,9 +239,9 @@ where type Error = E; forward_to_deserialize_any! { - bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit option - seq seq_fixed_size bytes map unit_struct newtype_struct tuple_struct - struct identifier tuple ignored_any byte_buf + bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes + byte_buf option unit unit_struct newtype_struct seq seq_fixed_size + tuple tuple_struct map struct identifier ignored_any } fn deserialize_any(self, visitor: V) -> Result @@ -332,9 +332,9 @@ where } forward_to_deserialize_any! { - bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit option - seq seq_fixed_size bytes map unit_struct newtype_struct tuple_struct - struct identifier tuple ignored_any byte_buf + bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes + byte_buf option unit unit_struct newtype_struct seq seq_fixed_size + tuple tuple_struct map struct identifier ignored_any } } @@ -407,9 +407,9 @@ where } forward_to_deserialize_any! { - bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit option - seq seq_fixed_size bytes map unit_struct newtype_struct tuple_struct - struct identifier tuple ignored_any byte_buf + bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes + byte_buf option unit unit_struct newtype_struct seq seq_fixed_size + tuple tuple_struct map struct identifier ignored_any } } @@ -486,9 +486,9 @@ where } forward_to_deserialize_any! { - bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit option - seq seq_fixed_size bytes map unit_struct newtype_struct tuple_struct - struct identifier tuple ignored_any byte_buf + bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes + byte_buf option unit unit_struct newtype_struct seq seq_fixed_size + tuple tuple_struct map struct identifier ignored_any } } @@ -572,9 +572,9 @@ where } forward_to_deserialize_any! { - bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit option - seq seq_fixed_size bytes map unit_struct newtype_struct tuple_struct - struct identifier tuple enum ignored_any byte_buf + bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes + byte_buf option unit unit_struct newtype_struct seq seq_fixed_size + tuple tuple_struct map struct identifier enum ignored_any } } @@ -686,9 +686,9 @@ where } forward_to_deserialize_any! { - bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit option - seq seq_fixed_size bytes map unit_struct newtype_struct tuple_struct - struct identifier tuple enum ignored_any byte_buf + bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes + byte_buf option unit unit_struct newtype_struct seq seq_fixed_size + tuple tuple_struct map struct identifier enum ignored_any } } @@ -804,9 +804,9 @@ where } forward_to_deserialize_any! { - bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit option - bytes map unit_struct newtype_struct tuple_struct struct identifier - tuple enum ignored_any byte_buf + bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes + byte_buf option unit unit_struct newtype_struct tuple tuple_struct + map struct identifier enum ignored_any } } @@ -945,9 +945,9 @@ where type Error = E; forward_to_deserialize_any! { - bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit option - bytes map unit_struct newtype_struct tuple_struct struct identifier - tuple enum ignored_any byte_buf + bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes + byte_buf option unit unit_struct newtype_struct tuple tuple_struct + map struct identifier enum ignored_any } fn deserialize_any(self, visitor: V) -> Result @@ -1092,9 +1092,9 @@ where } forward_to_deserialize_any! { - bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit option - seq seq_fixed_size bytes map unit_struct newtype_struct tuple_struct - struct identifier tuple enum ignored_any byte_buf + bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes + byte_buf option unit unit_struct newtype_struct seq seq_fixed_size + tuple tuple_struct map struct identifier enum ignored_any } } diff --git a/serde/src/macros.rs b/serde/src/macros.rs index 6b7ea6e2..b3d5d402 100644 --- a/serde/src/macros.rs +++ b/serde/src/macros.rs @@ -77,9 +77,9 @@ /// } /// /// forward_to_deserialize_any! { -/// bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit option -/// seq seq_fixed_size bytes byte_buf map unit_struct newtype_struct -/// tuple_struct struct identifier tuple enum ignored_any +/// bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes +/// byte_buf option unit unit_struct newtype_struct seq seq_fixed_size +/// tuple tuple_struct map struct identifier enum ignored_any /// } /// } /// # @@ -112,9 +112,9 @@ /// # /// forward_to_deserialize_any! { /// > -/// bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit option -/// seq seq_fixed_size bytes byte_buf map unit_struct newtype_struct -/// tuple_struct struct identifier tuple enum ignored_any +/// bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes +/// byte_buf option unit unit_struct newtype_struct seq seq_fixed_size +/// tuple tuple_struct map struct identifier enum ignored_any /// } /// # } /// # @@ -158,18 +158,6 @@ macro_rules! forward_to_deserialize_any_helper { (bool<$l:tt, $v:ident>) => { forward_to_deserialize_any_method!{deserialize_bool<$l, $v>()} }; - (u8<$l:tt, $v:ident>) => { - forward_to_deserialize_any_method!{deserialize_u8<$l, $v>()} - }; - (u16<$l:tt, $v:ident>) => { - forward_to_deserialize_any_method!{deserialize_u16<$l, $v>()} - }; - (u32<$l:tt, $v:ident>) => { - forward_to_deserialize_any_method!{deserialize_u32<$l, $v>()} - }; - (u64<$l:tt, $v:ident>) => { - forward_to_deserialize_any_method!{deserialize_u64<$l, $v>()} - }; (i8<$l:tt, $v:ident>) => { forward_to_deserialize_any_method!{deserialize_i8<$l, $v>()} }; @@ -182,6 +170,18 @@ macro_rules! forward_to_deserialize_any_helper { (i64<$l:tt, $v:ident>) => { forward_to_deserialize_any_method!{deserialize_i64<$l, $v>()} }; + (u8<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_u8<$l, $v>()} + }; + (u16<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_u16<$l, $v>()} + }; + (u32<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_u32<$l, $v>()} + }; + (u64<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_u64<$l, $v>()} + }; (f32<$l:tt, $v:ident>) => { forward_to_deserialize_any_method!{deserialize_f32<$l, $v>()} }; @@ -197,26 +197,17 @@ macro_rules! forward_to_deserialize_any_helper { (string<$l:tt, $v:ident>) => { forward_to_deserialize_any_method!{deserialize_string<$l, $v>()} }; - (unit<$l:tt, $v:ident>) => { - forward_to_deserialize_any_method!{deserialize_unit<$l, $v>()} - }; - (option<$l:tt, $v:ident>) => { - forward_to_deserialize_any_method!{deserialize_option<$l, $v>()} - }; - (seq<$l:tt, $v:ident>) => { - forward_to_deserialize_any_method!{deserialize_seq<$l, $v>()} - }; - (seq_fixed_size<$l:tt, $v:ident>) => { - forward_to_deserialize_any_method!{deserialize_seq_fixed_size<$l, $v>(len: usize)} - }; (bytes<$l:tt, $v:ident>) => { forward_to_deserialize_any_method!{deserialize_bytes<$l, $v>()} }; (byte_buf<$l:tt, $v:ident>) => { forward_to_deserialize_any_method!{deserialize_byte_buf<$l, $v>()} }; - (map<$l:tt, $v:ident>) => { - forward_to_deserialize_any_method!{deserialize_map<$l, $v>()} + (option<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_option<$l, $v>()} + }; + (unit<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_unit<$l, $v>()} }; (unit_struct<$l:tt, $v:ident>) => { forward_to_deserialize_any_method!{deserialize_unit_struct<$l, $v>(name: &'static str)} @@ -224,18 +215,27 @@ macro_rules! forward_to_deserialize_any_helper { (newtype_struct<$l:tt, $v:ident>) => { forward_to_deserialize_any_method!{deserialize_newtype_struct<$l, $v>(name: &'static str)} }; + (seq<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_seq<$l, $v>()} + }; + (seq_fixed_size<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_seq_fixed_size<$l, $v>(len: usize)} + }; + (tuple<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_tuple<$l, $v>(len: usize)} + }; (tuple_struct<$l:tt, $v:ident>) => { forward_to_deserialize_any_method!{deserialize_tuple_struct<$l, $v>(name: &'static str, len: usize)} }; + (map<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_map<$l, $v>()} + }; (struct<$l:tt, $v:ident>) => { forward_to_deserialize_any_method!{deserialize_struct<$l, $v>(name: &'static str, fields: &'static [&'static str])} }; (identifier<$l:tt, $v:ident>) => { forward_to_deserialize_any_method!{deserialize_identifier<$l, $v>()} }; - (tuple<$l:tt, $v:ident>) => { - forward_to_deserialize_any_method!{deserialize_tuple<$l, $v>(len: usize)} - }; (enum<$l:tt, $v:ident>) => { forward_to_deserialize_any_method!{deserialize_enum<$l, $v>(name: &'static str, variants: &'static [&'static str])} }; diff --git a/serde/src/private/de.rs b/serde/src/private/de.rs index 963585f0..33aecb4e 100644 --- a/serde/src/private/de.rs +++ b/serde/src/private/de.rs @@ -48,9 +48,9 @@ where } forward_to_deserialize_any! { - bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit seq - seq_fixed_size bytes byte_buf map unit_struct newtype_struct - tuple_struct struct identifier tuple enum ignored_any + bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes + byte_buf unit unit_struct newtype_struct seq seq_fixed_size tuple + tuple_struct map struct identifier enum ignored_any } } @@ -994,9 +994,9 @@ mod content { } forward_to_deserialize_any! { - bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit seq - seq_fixed_size bytes byte_buf map unit_struct tuple_struct struct - identifier tuple ignored_any + bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes + byte_buf unit unit_struct seq seq_fixed_size tuple tuple_struct map + struct identifier ignored_any } } @@ -1152,9 +1152,9 @@ mod content { } forward_to_deserialize_any! { - bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit option - seq seq_fixed_size bytes byte_buf map unit_struct newtype_struct - tuple_struct struct identifier tuple enum ignored_any + bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes + byte_buf option unit unit_struct newtype_struct seq seq_fixed_size + tuple tuple_struct map struct identifier enum ignored_any } } @@ -1253,9 +1253,9 @@ mod content { } forward_to_deserialize_any! { - bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit option - seq seq_fixed_size bytes byte_buf map unit_struct newtype_struct - tuple_struct struct identifier tuple enum ignored_any + bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes + byte_buf option unit unit_struct newtype_struct seq seq_fixed_size + tuple tuple_struct map struct identifier enum ignored_any } } @@ -1389,9 +1389,9 @@ mod content { } forward_to_deserialize_any! { - bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit seq - seq_fixed_size bytes byte_buf map unit_struct tuple_struct struct - identifier tuple ignored_any + bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes + byte_buf unit unit_struct seq seq_fixed_size tuple tuple_struct map + struct identifier ignored_any } } @@ -1544,9 +1544,9 @@ mod content { } forward_to_deserialize_any! { - bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit option - seq seq_fixed_size bytes byte_buf map unit_struct newtype_struct - tuple_struct struct identifier tuple enum ignored_any + bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes + byte_buf option unit unit_struct newtype_struct seq seq_fixed_size + tuple tuple_struct map struct identifier enum ignored_any } } @@ -1646,9 +1646,9 @@ mod content { } forward_to_deserialize_any! { - bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit option - seq seq_fixed_size bytes byte_buf map unit_struct newtype_struct - tuple_struct struct identifier tuple enum ignored_any + bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes + byte_buf option unit unit_struct newtype_struct seq seq_fixed_size + tuple tuple_struct map struct identifier enum ignored_any } } diff --git a/serde_test/src/de.rs b/serde_test/src/de.rs index 818b6294..a1f497c7 100644 --- a/serde_test/src/de.rs +++ b/serde_test/src/de.rs @@ -98,8 +98,8 @@ impl<'de, 'a> de::Deserializer<'de> for &'a mut Deserializer<'de> { type Error = Error; forward_to_deserialize_any! { - bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit - seq bytes byte_buf map identifier ignored_any + bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes + byte_buf unit seq map identifier ignored_any } fn deserialize_any(self, visitor: V) -> Result @@ -655,8 +655,8 @@ impl<'de> de::Deserializer<'de> for BytesDeserializer { } forward_to_deserialize_any! { - bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit option - seq seq_fixed_size bytes map unit_struct newtype_struct tuple_struct - struct identifier tuple enum ignored_any byte_buf + bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string bytes + byte_buf option unit unit_struct newtype_struct seq seq_fixed_size + tuple tuple_struct map struct identifier enum ignored_any } }