Skip to content

Commit

Permalink
Support deserializing map key as &RawValue
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Jan 22, 2022
1 parent 6a3fb68 commit e5cdfcc
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/de.rs
Expand Up @@ -2184,10 +2184,18 @@ where
}

#[inline]
fn deserialize_newtype_struct<V>(self, _name: &'static str, visitor: V) -> Result<V::Value>
fn deserialize_newtype_struct<V>(self, name: &'static str, visitor: V) -> Result<V::Value>
where
V: de::Visitor<'de>,
{
#[cfg(feature = "raw_value")]
{
if name == crate::raw::TOKEN {
return self.de.deserialize_raw_value(visitor);
}
}

let _ = name;
visitor.visit_newtype_struct(self)
}

Expand Down

0 comments on commit e5cdfcc

Please sign in to comment.