From e5cdfcc7ee482238a654afbf3c0116a9f852ce79 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sat, 22 Jan 2022 15:08:36 -0800 Subject: [PATCH] Support deserializing map key as &RawValue --- src/de.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/de.rs b/src/de.rs index bf103f04b..ffd0d48c2 100644 --- a/src/de.rs +++ b/src/de.rs @@ -2184,10 +2184,18 @@ where } #[inline] - fn deserialize_newtype_struct(self, _name: &'static str, visitor: V) -> Result + fn deserialize_newtype_struct(self, name: &'static str, visitor: V) -> Result 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) }