Fix clippy lint about looping over iter()

This commit is contained in:
David Tolnay committed 2016-08-03 19:32:51 -07:00
1 parent b289edd4a4
commit d0502b93ef
2 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -382,7 +382,7 @@ fn serialize_variant(
}
Style::Struct => {
let mut pat = builder.pat().struct_().id(type_ident).id(variant_ident).build();
for field in variant.fields.iter() {
for field in &variant.fields {
let name = match field.ident {
Some(name) => name,
None => cx.span_bug(field.span, "struct variant has unnamed fields"),