From cfad5e67c162ceb6c278e5dc68c54767a3d06f2c Mon Sep 17 00:00:00 2001 From: Jordan Doyle Date: Sat, 24 Jul 2021 18:07:15 +0100 Subject: [PATCH] Move unsigned types to the bottom of the impl --- src/ser.rs | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/ser.rs b/src/ser.rs index ef35b91..8957c12 100644 --- a/src/ser.rs +++ b/src/ser.rs @@ -61,22 +61,6 @@ impl<'a> serde::Serializer for Serializer<'a> { Ok(()) } - fn serialize_u8(self, _v: u8) -> Result { - Err(Error::UnsignedIntNotInSpec) - } - - fn serialize_u16(self, _v: u16) -> Result { - Err(Error::UnsignedIntNotInSpec) - } - - fn serialize_u32(self, _v: u32) -> Result { - Err(Error::UnsignedIntNotInSpec) - } - - fn serialize_u64(self, _v: u64) -> Result { - Err(Error::UnsignedIntNotInSpec) - } - fn serialize_f32(self, v: f32) -> Result { self.serialize_f64(v as f64) } @@ -87,10 +71,6 @@ impl<'a> serde::Serializer for Serializer<'a> { Ok(()) } - fn serialize_char(self, _: char) -> Result { - Err(Error::UnsignedIntNotInSpec) - } - fn serialize_str(self, v: &str) -> Result { write_key_or_error!(0x02, self.key, self.output); @@ -270,6 +250,26 @@ impl<'a> serde::Serializer for Serializer<'a> { ) -> Result { todo!("struct variant") } + + fn serialize_u8(self, _v: u8) -> Result { + Err(Error::UnsignedIntNotInSpec) + } + + fn serialize_u16(self, _v: u16) -> Result { + Err(Error::UnsignedIntNotInSpec) + } + + fn serialize_u32(self, _v: u32) -> Result { + Err(Error::UnsignedIntNotInSpec) + } + + fn serialize_u64(self, _v: u64) -> Result { + Err(Error::UnsignedIntNotInSpec) + } + + fn serialize_char(self, _: char) -> Result { + Err(Error::UnsignedIntNotInSpec) + } } pub struct TupleSerializer<'a> { -- libgit2 1.7.2