Skip to content

Commit

Permalink
Delete Deserializer impl from value::de::MapRefDeserializer
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Aug 28, 2021
1 parent cb1e730 commit cdc2ad3
Showing 1 changed file with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions src/value/de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1043,9 +1043,7 @@ impl<'de> VariantAccess<'de> for VariantRefDeserializer<'de> {
V: Visitor<'de>,
{
match self.value {
Some(&Value::Object(ref v)) => {
serde::Deserializer::deserialize_any(MapRefDeserializer::new(v), visitor)
}
Some(&Value::Object(ref v)) => visitor.visit_map(MapRefDeserializer::new(v)),
Some(other) => Err(serde::de::Error::invalid_type(
other.unexpected(),
&"struct variant",
Expand Down Expand Up @@ -1140,24 +1138,6 @@ impl<'de> MapAccess<'de> for MapRefDeserializer<'de> {
}
}

impl<'de> serde::Deserializer<'de> for MapRefDeserializer<'de> {
type Error = Error;

#[inline]
fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Error>
where
V: Visitor<'de>,
{
visitor.visit_map(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 unit unit_struct newtype_struct seq tuple
tuple_struct map struct enum identifier ignored_any
}
}

struct MapKeyDeserializer<'de> {
key: Cow<'de, str>,
}
Expand Down

0 comments on commit cdc2ad3

Please sign in to comment.