Skip to content

Commit

Permalink
forward deserialize_struct/ map to deserialize_any
Browse files Browse the repository at this point in the history
  • Loading branch information
Boog900 committed Jun 27, 2023
1 parent 346bc42 commit 6abd225
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ pub struct Deserializer<'b> {

impl<'b> Deserializer<'b> {
pub fn new(buffer: &'b mut dyn io::BufRead) -> Self {
Self { buffer, read_header: false }
Self {
buffer,
read_header: false,
}
}
}

Expand Down Expand Up @@ -485,8 +488,7 @@ impl<'de, 'a, 'b> serde::Deserializer<'de> for &'a mut Deserializer<'b> {
where
V: Visitor<'de>,
{
self.read_expected_marker(MARKER_SINGLE_STRUCT)?;
visitor.visit_map(MapAccess::with_varint_encoded_fields(self)?)
self.deserialize_any(visitor)
}

fn deserialize_struct<V>(
Expand All @@ -498,8 +500,7 @@ impl<'de, 'a, 'b> serde::Deserializer<'de> for &'a mut Deserializer<'b> {
where
V: Visitor<'de>,
{
self.read_expected_marker(MARKER_SINGLE_STRUCT)?;
visitor.visit_map(MapAccess::with_varint_encoded_fields(self)?)
self.deserialize_any(visitor)
}

fn deserialize_enum<V>(
Expand Down

0 comments on commit 6abd225

Please sign in to comment.