]> git.lizzy.rs Git - rust.git/commitdiff
Minor perf change: `vec.clone().into_iter()` => `vec.iter().cloned()`
authorChayim Refael Friedman <chayimfr@gmail.com>
Fri, 25 Feb 2022 01:00:24 +0000 (01:00 +0000)
committerGitHub <noreply@github.com>
Fri, 25 Feb 2022 01:25:42 +0000 (01:25 +0000)
crates/ide_assists/src/handlers/extract_module.rs

index f43aa61fcb1fac044c7906c11fb8cda704ceb04c..880617dd38d22d452f24aebe95239763c28d2f63 100644 (file)
@@ -179,7 +179,7 @@ fn get_usages_and_record_fields(
         //Here impl is not included as each item inside impl will be tied to the parent of
         //implementing block(a struct, enum, etc), if the parent is in selected module, it will
         //get updated by ADT section given below or if it is not, then we dont need to do any operation
-        self.body_items.clone().into_iter().for_each(|item| {
+        self.body_items.iter().cloned().for_each(|item| {
             match_ast! {
                 match (item.syntax()) {
                     ast::Adt(it) => {