Format with rustfmt 2018-11-30

This commit is contained in:
David Tolnay
2018-12-10 22:09:02 -08:00
parent 8b4074ee77
commit 16daba8ea9
6 changed files with 230 additions and 154 deletions
+8 -4
View File
@@ -89,7 +89,10 @@ fn precondition_sized(cx: &Ctxt, cont: &Container) {
if let Data::Struct(_, ref fields) = cont.data {
if let Some(last) = fields.last() {
if let syn::Type::Slice(_) = *last.ty {
cx.error_spanned_by(cont.original, "cannot deserialize a dynamically sized struct");
cx.error_spanned_by(
cont.original,
"cannot deserialize a dynamically sized struct",
);
}
}
}
@@ -366,7 +369,7 @@ fn deserialize_transparent(cont: &Container, params: &Parameters) -> Fragment {
None => {
let span = transparent_field.original.span();
quote_spanned!(span=> _serde::Deserialize::deserialize)
},
}
};
let assign = fields.iter().map(|field| {
@@ -1830,7 +1833,8 @@ fn deserialize_externally_tagged_newtype_variant(
None => {
let field_ty = field.ty;
let span = field.original.span();
let func = quote_spanned!(span=> _serde::de::VariantAccess::newtype_variant::<#field_ty>);
let func =
quote_spanned!(span=> _serde::de::VariantAccess::newtype_variant::<#field_ty>);
quote_expr! {
_serde::export::Result::map(#func(__variant), #this::#variant_ident)
}
@@ -2470,7 +2474,7 @@ fn deserialize_map(
None => {
let span = field.original.span();
quote_spanned!(span=> _serde::de::Deserialize::deserialize)
},
}
Some(path) => quote!(#path),
};
quote! {