Heed the advice of rustc's into_iter() warning

This commit is contained in:
memoryruins 2019-11-15 06:53:11 -05:00
parent 5476c4faa3
commit a5f57f98ca

View file

@ -241,10 +241,8 @@ mod tests {
// } // }
let struct_name = mk_ident("Foo"); let struct_name = mk_ident("Foo");
let fields = [mk_ident("name"), mk_ident("id")]; let fields = [mk_ident("name"), mk_ident("id")];
let fields = fields let fields =
.into_iter() fields.iter().map(|it| quote!(#it: self.#it.clone(), ).token_trees.clone()).flatten();
.map(|it| quote!(#it: self.#it.clone(), ).token_trees.clone())
.flatten();
let list = tt::Subtree { delimiter: tt::Delimiter::Brace, token_trees: fields.collect() }; let list = tt::Subtree { delimiter: tt::Delimiter::Brace, token_trees: fields.collect() };