1
Fork 0

Auto merge of #100497 - kadiwa4:remove_clone_into_iter, r=cjgillot

Avoid cloning a collection only to iterate over it

`@rustbot` label: +C-cleanup
This commit is contained in:
bors 2022-08-28 18:31:08 +00:00
commit ce36e88256
12 changed files with 31 additions and 31 deletions

View file

@ -383,8 +383,7 @@ fn find_type_parameters(
// Place bound generic params on a stack, to extract them when a type is encountered.
fn visit_poly_trait_ref(&mut self, trait_ref: &'a ast::PolyTraitRef) {
let stack_len = self.bound_generic_params_stack.len();
self.bound_generic_params_stack
.extend(trait_ref.bound_generic_params.clone().into_iter());
self.bound_generic_params_stack.extend(trait_ref.bound_generic_params.iter().cloned());
visit::walk_poly_trait_ref(self, trait_ref);