diff --git a/serde/src/ser/fmt.rs b/serde/src/ser/fmt.rs index bc9623c6..f6e890d4 100644 --- a/serde/src/ser/fmt.rs +++ b/serde/src/ser/fmt.rs @@ -54,6 +54,13 @@ impl<'a, 'b> Serializer for &'a mut fmt::Formatter<'b> { Display::fmt(variant, self) } + fn serialize_newtype_struct(self, _name: &'static str, value: &T) -> fmt::Result + where + T: Serialize, + { + Serialize::serialize(value, self) + } + fn serialize_bytes(self, _v: &[u8]) -> fmt::Result { Err(fmt::Error) } @@ -73,13 +80,6 @@ impl<'a, 'b> Serializer for &'a mut fmt::Formatter<'b> { Err(fmt::Error) } - fn serialize_newtype_struct(self, _name: &'static str, _value: &T) -> fmt::Result - where - T: Serialize, - { - Err(fmt::Error) - } - fn serialize_newtype_variant( self, _name: &'static str,