1
Fork 0

avoid cloning and then iterating

This commit is contained in:
KaDiWa 2022-08-13 15:50:01 +02:00
parent 75b7e52e92
commit 4eebcb9910
No known key found for this signature in database
GPG key ID: 0B52AE391C674CE5
12 changed files with 31 additions and 31 deletions

View file

@ -385,8 +385,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);