From 88470e2452b9825ace87ebe2b686a4f93c050e57 Mon Sep 17 00:00:00 2001 From: Steven Pease Date: Sat, 27 Oct 2018 18:28:18 -0700 Subject: Allow newtype key --- src/ser.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ser.rs b/src/ser.rs index 9f36f59..e1fe1a2 100644 --- a/src/ser.rs +++ b/src/ser.rs @@ -1420,11 +1420,11 @@ impl ser::Serializer for StringExtractor { Err(Error::KeyNotString) } - fn serialize_newtype_struct(self, _name: &'static str, _value: &T) + fn serialize_newtype_struct(self, _name: &'static str, value: &T) -> Result where T: ser::Serialize, { - Err(Error::KeyNotString) + value.serialize(self) } fn serialize_newtype_variant(self, -- cgit v1.2.3