From 16bf9871cd6f14baffde3c8ae0e57038e2c166d2 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sat, 9 May 2020 17:27:17 -0700 Subject: [PATCH] Remove serialize_unit from Formatter's impl --- serde/src/ser/fmt.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/serde/src/ser/fmt.rs b/serde/src/ser/fmt.rs index 65c16562..016ed3ba 100644 --- a/serde/src/ser/fmt.rs +++ b/serde/src/ser/fmt.rs @@ -45,10 +45,6 @@ impl<'a, 'b> Serializer for &'a mut fmt::Formatter<'b> { serialize_unit_struct: &'static str, } - fn serialize_unit(self) -> fmt::Result { - Ok(()) - } - fn serialize_unit_variant( self, _name: &'static str, @@ -73,6 +69,10 @@ impl<'a, 'b> Serializer for &'a mut fmt::Formatter<'b> { Err(fmt::Error) } + fn serialize_unit(self) -> fmt::Result { + Err(fmt::Error) + } + fn serialize_newtype_struct(self, _name: &'static str, _value: &T) -> fmt::Result where T: Serialize,