Resolve conflict between rename changes and skip changes

This commit is contained in:
David Tolnay 2017-01-13 01:27:07 -08:00
parent 7cc24a43fb
commit 8c49e6d6a5
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82

View File

@ -702,20 +702,11 @@ fn deserialize_struct_visitor(
fields: &[Field],
item_attrs: &attr::Item,
) -> (Tokens, Tokens, Tokens) {
<<<<<<< HEAD
let field_names_idents = fields.iter()
.enumerate()
.filter(|&(_, field)| !field.attrs.skip_deserializing())
.map(|(i, field)| (field.attrs.name().deserialize_name(), field_i(i)))
||||||| merged common ancestors
let field_exprs = fields.iter()
.map(|field| field.attrs.name().deserialize_name())
=======
let field_exprs: Vec<_> = fields.iter()
.map(|field| field.attrs.name().deserialize_name())
>>>>>>> origin/master
.collect();
let field_names = field_exprs.clone();
let field_visitor = deserialize_field_visitor(
field_names_idents,
@ -731,6 +722,7 @@ fn deserialize_struct_visitor(
item_attrs,
);
let field_names = fields.iter().map(|field| field.attrs.name().deserialize_name());
let fields_stmt = quote! {
const FIELDS: &'static [&'static str] = &[ #(#field_names),* ];
};