Reorder variables to match order in final quote!
This commit is contained in:
parent
935f0bd70f
commit
3a3e6bf103
@ -1171,13 +1171,21 @@ fn deserialize_struct_in_place(
|
|||||||
})
|
})
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
let field_visitor = deserialize_generated_identifier(&field_names_idents, cattrs, false, None);
|
let field_visitor = Stmts(deserialize_generated_identifier(
|
||||||
|
&field_names_idents,
|
||||||
|
cattrs,
|
||||||
|
false,
|
||||||
|
None,
|
||||||
|
));
|
||||||
|
|
||||||
|
let all_skipped = fields.iter().all(|field| field.attrs.skip_deserializing());
|
||||||
|
let visitor_var = if all_skipped {
|
||||||
|
quote!(_)
|
||||||
|
} else {
|
||||||
|
quote!(mut __seq)
|
||||||
|
};
|
||||||
let visit_seq = Stmts(deserialize_seq_in_place(params, fields, cattrs, expecting));
|
let visit_seq = Stmts(deserialize_seq_in_place(params, fields, cattrs, expecting));
|
||||||
let visit_map = deserialize_map_in_place(params, fields, cattrs);
|
let visit_map = Stmts(deserialize_map_in_place(params, fields, cattrs));
|
||||||
|
|
||||||
let field_visitor = Stmts(field_visitor);
|
|
||||||
let visit_map = Stmts(visit_map);
|
|
||||||
let field_names = field_names_idents.iter().map(|(name, _, _)| name);
|
let field_names = field_names_idents.iter().map(|(name, _, _)| name);
|
||||||
|
|
||||||
let visitor_expr = quote! {
|
let visitor_expr = quote! {
|
||||||
@ -1201,13 +1209,6 @@ fn deserialize_struct_in_place(
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
let all_skipped = fields.iter().all(|field| field.attrs.skip_deserializing());
|
|
||||||
let visitor_var = if all_skipped {
|
|
||||||
quote!(_)
|
|
||||||
} else {
|
|
||||||
quote!(mut __seq)
|
|
||||||
};
|
|
||||||
|
|
||||||
let in_place_impl_generics = de_impl_generics.in_place();
|
let in_place_impl_generics = de_impl_generics.in_place();
|
||||||
let in_place_ty_generics = de_ty_generics.in_place();
|
let in_place_ty_generics = de_ty_generics.in_place();
|
||||||
let place_life = place_lifetime();
|
let place_life = place_lifetime();
|
||||||
|
Loading…
Reference in New Issue
Block a user