summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlex Orlenko <zxteam@protonmail.com>2022-05-24 23:26:17 +0100
committerAlex Orlenko <zxteam@protonmail.com>2022-05-24 23:26:17 +0100
commit30ba616a8a364d21b8672431f478b318270f9f6f (patch)
tree815d5ba7d17f473797007d92a634f25107c911e6 /src
parent0076aa735ac6be9dc84bebbc92272369d8f3cfba (diff)
downloadmlua-30ba616a8a364d21b8672431f478b318270f9f6f.zip
Correctly deserialize newtype struct (#168)
Diffstat (limited to 'src')
-rw-r--r--src/serde/de.rs11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/serde/de.rs b/src/serde/de.rs
index 3e4bb14..25ab9ec 100644
--- a/src/serde/de.rs
+++ b/src/serde/de.rs
@@ -320,10 +320,17 @@ impl<'lua, 'de> serde::Deserializer<'de> for Deserializer<'lua> {
self.deserialize_map(visitor)
}
+ #[inline]
+ fn deserialize_newtype_struct<V>(self, _name: &'static str, visitor: V) -> Result<V::Value>
+ where
+ V: de::Visitor<'de>,
+ {
+ visitor.visit_newtype_struct(self)
+ }
+
serde::forward_to_deserialize_any! {
bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string bytes
- byte_buf unit unit_struct newtype_struct
- identifier ignored_any
+ byte_buf unit unit_struct identifier ignored_any
}
}