Skip to content

Commit

Permalink
Format with rustfmt 2019-10-07
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Nov 26, 2019
1 parent 13d0899 commit d540e72
Showing 2 changed files with 20 additions and 8 deletions.
24 changes: 18 additions & 6 deletions serde_derive/src/ser.rs
Original file line number Diff line number Diff line change
@@ -1273,9 +1273,15 @@ enum StructTrait {
impl StructTrait {
fn serialize_field(&self, span: Span) -> TokenStream {
match *self {
StructTrait::SerializeMap => quote_spanned!(span=> _serde::ser::SerializeMap::serialize_entry),
StructTrait::SerializeStruct => quote_spanned!(span=> _serde::ser::SerializeStruct::serialize_field),
StructTrait::SerializeStructVariant => quote_spanned!(span=> _serde::ser::SerializeStructVariant::serialize_field),
StructTrait::SerializeMap => {
quote_spanned!(span=> _serde::ser::SerializeMap::serialize_entry)
}
StructTrait::SerializeStruct => {
quote_spanned!(span=> _serde::ser::SerializeStruct::serialize_field)
}
StructTrait::SerializeStructVariant => {
quote_spanned!(span=> _serde::ser::SerializeStructVariant::serialize_field)
}
}
}

@@ -1301,9 +1307,15 @@ enum TupleTrait {
impl TupleTrait {
fn serialize_element(&self, span: Span) -> TokenStream {
match *self {
TupleTrait::SerializeTuple => quote_spanned!(span=> _serde::ser::SerializeTuple::serialize_element),
TupleTrait::SerializeTupleStruct => quote_spanned!(span=> _serde::ser::SerializeTupleStruct::serialize_field),
TupleTrait::SerializeTupleVariant => quote_spanned!(span=> _serde::ser::SerializeTupleVariant::serialize_field),
TupleTrait::SerializeTuple => {
quote_spanned!(span=> _serde::ser::SerializeTuple::serialize_element)
}
TupleTrait::SerializeTupleStruct => {
quote_spanned!(span=> _serde::ser::SerializeTupleStruct::serialize_field)
}
TupleTrait::SerializeTupleVariant => {
quote_spanned!(span=> _serde::ser::SerializeTupleVariant::serialize_field)
}
}
}
}
4 changes: 2 additions & 2 deletions test_suite/tests/expand/ser_enum.rs
Original file line number Diff line number Diff line change
@@ -2,8 +2,8 @@ use serde::Serialize;

#[derive(Serialize)]
enum SerEnum<'a, B: 'a, C: 'a, D>
where
D: 'a,
where
D: 'a,
{
Unit,
Seq(i8, B, &'a C, &'a mut D),

0 comments on commit d540e72

Please sign in to comment.