Merge pull request #271 from spease/allow-newtype-key

Allow newtype key
This commit is contained in:
Alex Crichton 2018-10-29 09:57:55 -07:00 committed by GitHub
commit 80d2cf081d

View file

@ -1420,11 +1420,11 @@ impl ser::Serializer for StringExtractor {
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>
where T: ser::Serialize,
{
Err(Error::KeyNotString)
value.serialize(self)
}
fn serialize_newtype_variant<T: ?Sized>(self,