diff --git a/serde/src/de/mod.rs b/serde/src/de/mod.rs index b06a4ce3..af18eaef 100644 --- a/serde/src/de/mod.rs +++ b/serde/src/de/mod.rs @@ -332,8 +332,8 @@ pub trait Deserializer { /// deserializers to a unit struct that aren't tagged as a unit struct. #[inline] fn deserialize_unit_struct(&mut self, - _name: &'static str, - visitor: V) -> Result + _name: &'static str, + visitor: V) -> Result where V: Visitor, { self.deserialize_unit(visitor) @@ -343,8 +343,8 @@ pub trait Deserializer { /// deserializers to a newtype struct that aren't tagged as a newtype struct. #[inline] fn deserialize_newtype_struct(&mut self, - name: &'static str, - visitor: V) -> Result + name: &'static str, + visitor: V) -> Result where V: Visitor, { self.deserialize_tuple_struct(name, 1, visitor) @@ -354,9 +354,9 @@ pub trait Deserializer { /// deserializers to parse sequences that aren't tagged as sequences. #[inline] fn deserialize_tuple_struct(&mut self, - _name: &'static str, - len: usize, - visitor: V) -> Result + _name: &'static str, + len: usize, + visitor: V) -> Result where V: Visitor, { self.deserialize_tuple(len, visitor) @@ -366,9 +366,9 @@ pub trait Deserializer { /// deserializers to parse sequences that aren't tagged as maps. #[inline] fn deserialize_struct(&mut self, - _name: &'static str, - _fields: &'static [&'static str], - visitor: V) -> Result + _name: &'static str, + _fields: &'static [&'static str], + visitor: V) -> Result where V: Visitor, { self.deserialize_map(visitor) @@ -388,9 +388,9 @@ pub trait Deserializer { /// type. #[inline] fn deserialize_enum(&mut self, - _enum: &'static str, - _variants: &'static [&'static str], - _visitor: V) -> Result + _enum: &'static str, + _variants: &'static [&'static str], + _visitor: V) -> Result where V: EnumVisitor, { Err(Error::syntax("expected an enum")) @@ -843,8 +843,8 @@ impl<'a, T> VariantVisitor for &'a mut T where T: VariantVisitor { } fn visit_struct(&mut self, - fields: &'static [&'static str], - visitor: V) -> Result + fields: &'static [&'static str], + visitor: V) -> Result where V: Visitor, { (**self).visit_struct(fields, visitor) diff --git a/serde/src/ser/mod.rs b/serde/src/ser/mod.rs index 64bdbdfa..636517cb 100644 --- a/serde/src/ser/mod.rs +++ b/serde/src/ser/mod.rs @@ -146,9 +146,9 @@ pub trait Serializer { /// By default, unit variants are serialized as a `()`. #[inline] fn serialize_unit_variant(&mut self, - _name: &'static str, - _variant_index: usize, - _variant: &'static str) -> Result<(), Self::Error> { + _name: &'static str, + _variant_index: usize, + _variant: &'static str) -> Result<(), Self::Error> { self.serialize_unit() } @@ -157,8 +157,8 @@ pub trait Serializer { /// By default it just serializes the value as a tuple struct sequence. #[inline] fn serialize_newtype_struct(&mut self, - name: &'static str, - value: T) -> Result<(), Self::Error> + name: &'static str, + value: T) -> Result<(), Self::Error> where T: Serialize, { self.serialize_tuple_struct(name, Some(value)) @@ -169,10 +169,10 @@ pub trait Serializer { /// tuple variant sequence. #[inline] fn serialize_newtype_variant(&mut self, - name: &'static str, - variant_index: usize, - variant: &'static str, - value: T) -> Result<(), Self::Error> + name: &'static str, + variant_index: usize, + variant: &'static str, + value: T) -> Result<(), Self::Error> where T: Serialize, { self.serialize_tuple_variant( @@ -225,8 +225,8 @@ pub trait Serializer { /// By default, tuple structs are serialized as a tuple. #[inline] fn serialize_tuple_struct(&mut self, - _name: &'static str, - visitor: V) -> Result<(), Self::Error> + _name: &'static str, + visitor: V) -> Result<(), Self::Error> where V: SeqVisitor, { self.serialize_tuple(visitor) @@ -247,10 +247,10 @@ pub trait Serializer { /// By default, tuple variants are serialized as a tuple struct. #[inline] fn serialize_tuple_variant(&mut self, - _name: &'static str, - _variant_index: usize, - variant: &'static str, - visitor: V) -> Result<(), Self::Error> + _name: &'static str, + _variant_index: usize, + variant: &'static str, + visitor: V) -> Result<(), Self::Error> where V: SeqVisitor, { self.serialize_tuple_struct(variant, visitor) @@ -283,8 +283,8 @@ pub trait Serializer { /// By default, structs are serialized as a map with the field name as the key. #[inline] fn serialize_struct(&mut self, - _name: &'static str, - visitor: V) -> Result<(), Self::Error> + _name: &'static str, + visitor: V) -> Result<(), Self::Error> where V: MapVisitor, { self.serialize_map(visitor) @@ -295,8 +295,8 @@ pub trait Serializer { /// By default, struct elements are serialized as a map element with the field name as the key. #[inline] fn serialize_struct_elt(&mut self, - key: &'static str, - value: V) -> Result<(), Self::Error> + key: &'static str, + value: V) -> Result<(), Self::Error> where V: Serialize, { self.serialize_map_elt(key, value) @@ -307,10 +307,10 @@ pub trait Serializer { /// By default, struct variants are serialized as a struct. #[inline] fn serialize_struct_variant(&mut self, - _name: &'static str, - _variant_index: usize, - variant: &'static str, - visitor: V) -> Result<(), Self::Error> + _name: &'static str, + _variant_index: usize, + variant: &'static str, + visitor: V) -> Result<(), Self::Error> where V: MapVisitor, { self.serialize_struct(variant, visitor) @@ -321,8 +321,8 @@ pub trait Serializer { /// By default, struct variant elements are serialized as a struct element. #[inline] fn serialize_struct_variant_elt(&mut self, - key: &'static str, - value: V) -> Result<(), Self::Error> + key: &'static str, + value: V) -> Result<(), Self::Error> where V: Serialize, { self.serialize_struct_elt(key, value)