aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_assists/src/handlers/expand_glob_import.rs
diff options
context:
space:
mode:
authorMatthias Krüger <[email protected]>2021-03-21 12:13:34 +0000
committerMatthias Krüger <[email protected]>2021-03-21 12:13:34 +0000
commitae7e55c1dd801c60092205ec8890179e10a47814 (patch)
tree7e55e7a0c144610d55509b3e28bde0edf0953e39 /crates/ide_assists/src/handlers/expand_glob_import.rs
parentbd407a9882250cbbb0897faba08e7d5ef80a4862 (diff)
clippy::complexity simplifications related to Iterators
Diffstat (limited to 'crates/ide_assists/src/handlers/expand_glob_import.rs')
-rw-r--r--crates/ide_assists/src/handlers/expand_glob_import.rs19
1 files changed, 7 insertions, 12 deletions
diff --git a/crates/ide_assists/src/handlers/expand_glob_import.rs b/crates/ide_assists/src/handlers/expand_glob_import.rs
index 83aa11d52..98389e4f7 100644
--- a/crates/ide_assists/src/handlers/expand_glob_import.rs
+++ b/crates/ide_assists/src/handlers/expand_glob_import.rs
@@ -136,18 +136,13 @@ impl Refs {
136 .into_iter() 136 .into_iter()
137 .filter(|r| { 137 .filter(|r| {
138 if let Def::ModuleDef(ModuleDef::Trait(tr)) = r.def { 138 if let Def::ModuleDef(ModuleDef::Trait(tr)) = r.def {
139 if tr 139 if tr.items(ctx.db()).into_iter().any(|ai| {
140 .items(ctx.db()) 140 if let AssocItem::Function(f) = ai {
141 .into_iter() 141 Def::ModuleDef(ModuleDef::Function(f)).is_referenced_in(ctx)
142 .find(|ai| { 142 } else {
143 if let AssocItem::Function(f) = *ai { 143 false
144 Def::ModuleDef(ModuleDef::Function(f)).is_referenced_in(ctx) 144 }
145 } else { 145 }) {
146 false
147 }
148 })
149 .is_some()
150 {
151 return true; 146 return true;
152 } 147 }
153 } 148 }