aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2018-10-29 09:57:55 -0700
committerGitHub <noreply@github.com>2018-10-29 09:57:55 -0700
commitf610ef33f4c12e363945ad3c80a1129b0389a699 (patch)
tree296224178e6eb4e2b3a40579974e9e93af9f480b /src
parent2a6d85b0dde5772241a2cf7e0ac8427949bc4112 (diff)
parent88470e2452b9825ace87ebe2b686a4f93c050e57 (diff)
downloadmilf-rs-f610ef33f4c12e363945ad3c80a1129b0389a699.tar.gz
milf-rs-f610ef33f4c12e363945ad3c80a1129b0389a699.zip
Merge pull request #271 from spease/allow-newtype-key
Allow newtype key
Diffstat (limited to 'src')
-rw-r--r--src/ser.rs4
1 files 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<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,