diff options
Diffstat (limited to 'crates/ra_assists/src/utils.rs')
-rw-r--r-- | crates/ra_assists/src/utils.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/ra_assists/src/utils.rs b/crates/ra_assists/src/utils.rs index 7628933fb..461f01536 100644 --- a/crates/ra_assists/src/utils.rs +++ b/crates/ra_assists/src/utils.rs | |||
@@ -9,14 +9,13 @@ use hir::db::HirDatabase; | |||
9 | 9 | ||
10 | use rustc_hash::FxHashSet; | 10 | use rustc_hash::FxHashSet; |
11 | 11 | ||
12 | /// Generate a collection of associated items that are missing from a | 12 | /// Generate a collection of associated items that are missing from a |
13 | /// `impl Trait for` block. | 13 | /// `impl Trait for` block. |
14 | pub fn get_missing_impl_items( | 14 | pub fn get_missing_impl_items( |
15 | db: &impl HirDatabase, | 15 | db: &impl HirDatabase, |
16 | analyzer: &hir::SourceAnalyzer, | 16 | analyzer: &hir::SourceAnalyzer, |
17 | impl_block: &ast::ImplBlock, | 17 | impl_block: &ast::ImplBlock, |
18 | ) -> Vec<hir::AssocItem> { | 18 | ) -> Vec<hir::AssocItem> { |
19 | |||
20 | // Names must be unique between constants and functions. However, type aliases | 19 | // Names must be unique between constants and functions. However, type aliases |
21 | // may share the same name as a function or constant. | 20 | // may share the same name as a function or constant. |
22 | let mut impl_fns_consts = FxHashSet::default(); | 21 | let mut impl_fns_consts = FxHashSet::default(); |
@@ -53,9 +52,10 @@ pub fn get_missing_impl_items( | |||
53 | .filter(|i| match i { | 52 | .filter(|i| match i { |
54 | hir::AssocItem::Function(f) => !impl_fns_consts.contains(&f.name(db).to_string()), | 53 | hir::AssocItem::Function(f) => !impl_fns_consts.contains(&f.name(db).to_string()), |
55 | hir::AssocItem::TypeAlias(t) => !impl_type.contains(&t.name(db).to_string()), | 54 | hir::AssocItem::TypeAlias(t) => !impl_type.contains(&t.name(db).to_string()), |
56 | hir::AssocItem::Const(c) => { | 55 | hir::AssocItem::Const(c) => c |
57 | c.name(db).map(|n| !impl_fns_consts.contains(&n.to_string())).unwrap_or_default() | 56 | .name(db) |
58 | } | 57 | .map(|n| !impl_fns_consts.contains(&n.to_string())) |
58 | .unwrap_or_default(), | ||
59 | }) | 59 | }) |
60 | .map(|i| i.clone()) | 60 | .map(|i| i.clone()) |
61 | .collect() | 61 | .collect() |