diff --git a/serde/src/ser/impls.rs b/serde/src/ser/impls.rs index 07f4698d..3efa6545 100644 --- a/serde/src/ser/impls.rs +++ b/serde/src/ser/impls.rs @@ -613,7 +613,10 @@ impl Serialize for Result where T: Serialize, E: Serialize { fn serialize(&self, serializer: &mut S) -> Result<(), S::Error> where S: Serializer { match *self { Result::Ok(ref field0) => { - struct Visitor<'a, T, E> where T: Serialize + 'a, E: Serialize + 'a { + struct Visitor<'a, T, E> + where T: Serialize + 'a, + E: Serialize + 'a + { state: usize, value: (&'a T,), _structure_ty: PhantomData<&'a Result>, @@ -653,7 +656,10 @@ impl Serialize for Result where T: Serialize, E: Serialize { serializer.visit_enum_seq("Result", 0, "Ok", visitor) } Result::Err(ref field0) => { - struct Visitor<'a, T, E> where T: Serialize + 'a, E: Serialize + 'a { + struct Visitor<'a, T, E> + where T: Serialize + 'a, + E: Serialize + 'a + { state: usize, value: (&'a E,), _structure_ty: PhantomData<&'a Result>, diff --git a/serde_codegen/src/attr.rs b/serde_codegen/src/attr.rs index 8d04b068..9f08969d 100644 --- a/serde_codegen/src/attr.rs +++ b/serde_codegen/src/attr.rs @@ -21,7 +21,6 @@ pub struct FieldAttrs { } impl FieldAttrs { - /// Create a FieldAttr with a single default field name pub fn new(default_value: bool, name: P) -> FieldAttrs { FieldAttrs { @@ -35,7 +34,7 @@ impl FieldAttrs { default_value: bool, default_name: P, formats: HashMap, P>, - ) -> FieldAttrs { + ) -> FieldAttrs { FieldAttrs { names: FieldNames::Format { formats: formats, diff --git a/serde_tests/tests/test_ser.rs b/serde_tests/tests/test_ser.rs index 0683b055..a06ef952 100644 --- a/serde_tests/tests/test_ser.rs +++ b/serde_tests/tests/test_ser.rs @@ -89,7 +89,11 @@ impl<'a> Serializer for AssertSerializer<'a> { name: &str, _variant_index: usize, variant: &str) -> Result<(), ()> { - assert_eq!(self.iter.next().unwrap(), Token::EnumUnit(name, variant)); + assert_eq!( + self.iter.next().unwrap(), + Token::EnumUnit(name, variant) + ); + Ok(()) } @@ -196,7 +200,10 @@ impl<'a> Serializer for AssertSerializer<'a> { { let len = visitor.len(); - assert_eq!(self.iter.next().unwrap(), Token::TupleStructStart(name, len)); + assert_eq!( + self.iter.next().unwrap(), + Token::TupleStructStart(name, len) + ); self.visit_sequence(visitor) } @@ -210,7 +217,10 @@ impl<'a> Serializer for AssertSerializer<'a> { { let len = visitor.len(); - assert_eq!(self.iter.next().unwrap(), Token::EnumSeqStart(name, variant, len)); + assert_eq!( + self.iter.next().unwrap(), + Token::EnumSeqStart(name, variant, len) + ); self.visit_sequence(visitor) } @@ -237,7 +247,10 @@ impl<'a> Serializer for AssertSerializer<'a> { { let len = visitor.len(); - assert_eq!(self.iter.next().unwrap(), Token::StructStart(name, len)); + assert_eq!( + self.iter.next().unwrap(), + Token::StructStart(name, len) + ); self.visit_mapping(visitor) } @@ -251,7 +264,10 @@ impl<'a> Serializer for AssertSerializer<'a> { { let len = visitor.len(); - assert_eq!(self.iter.next().unwrap(), Token::EnumMapStart(name, variant, len)); + assert_eq!( + self.iter.next().unwrap(), + Token::EnumMapStart(name, variant, len) + ); self.visit_mapping(visitor) }