Allow newtype key

This commit is contained in:
Steven Pease 2018-10-27 18:28:18 -07:00
parent f07ba88de4
commit d75c9ccd00

View file

@ -1420,11 +1420,11 @@ impl ser::Serializer for StringExtractor {
Err(Error::KeyNotString) Err(Error::KeyNotString)
} }
fn serialize_newtype_struct<T: ?Sized>(self, _name: &'static str, _value: &T) fn serialize_newtype_struct<T: ?Sized>(self, _name: &'static str, value: &T)
-> Result<String, Self::Error> -> Result<String, Self::Error>
where T: ser::Serialize, where T: ser::Serialize,
{ {
Err(Error::KeyNotString) value.serialize(self)
} }
fn serialize_newtype_variant<T: ?Sized>(self, fn serialize_newtype_variant<T: ?Sized>(self,