diff --git a/serde_derive/src/ser.rs b/serde_derive/src/ser.rs index 4c1a0d6f..bbd83d66 100644 --- a/serde_derive/src/ser.rs +++ b/serde_derive/src/ser.rs @@ -319,8 +319,7 @@ fn serialize_struct_as_struct( .filter(|&field| !field.attrs.skip_serializing()) .peekable(); - let let_mut = mut_if(serialized_fields.peek().is_some() || - additional_field_count > 0); + let let_mut = mut_if(serialized_fields.peek().is_some() || additional_field_count > 0); let len = serialized_fields .map(|field| match field.attrs.skip_serializing_if() { diff --git a/test_suite/tests/test_macros.rs b/test_suite/tests/test_macros.rs index 3e6e3f1b..e034af68 100644 --- a/test_suite/tests/test_macros.rs +++ b/test_suite/tests/test_macros.rs @@ -1420,12 +1420,9 @@ fn test_internally_tagged_braced_struct_with_zero_fields() { struct S {} assert_tokens( - &S{ }, + &S {}, &[ - Token::Struct { - name: "S", - len: 1, - }, + Token::Struct { name: "S", len: 1 }, Token::Str("type"), Token::Str("S"), Token::StructEnd,