From ca42a52051e69d441b3f32ba4268286a8f0d8685 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Mon, 4 Jan 2021 18:33:05 +0200 Subject: Code review fixes --- crates/completion/src/completions/unqualified_path.rs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'crates/completion/src') diff --git a/crates/completion/src/completions/unqualified_path.rs b/crates/completion/src/completions/unqualified_path.rs index 068b6b407..f376ded57 100644 --- a/crates/completion/src/completions/unqualified_path.rs +++ b/crates/completion/src/completions/unqualified_path.rs @@ -3,7 +3,7 @@ use std::iter; use either::Either; -use hir::{Adt, AsAssocItem, ModPath, ModuleDef, ScopeDef, Type}; +use hir::{Adt, ModPath, ModuleDef, ScopeDef, Type}; use ide_db::helpers::insert_use::ImportScope; use ide_db::imports_locator; use syntax::AstNode; @@ -142,15 +142,8 @@ fn fuzzy_completion(acc: &mut Completions, ctx: &CompletionContext) -> Option<() Some(40), potential_import_name, true, + true, ) - .filter(|import_candidate| match import_candidate { - Either::Left(ModuleDef::Function(function)) => function.as_assoc_item(ctx.db).is_none(), - Either::Left(ModuleDef::Const(const_)) => const_.as_assoc_item(ctx.db).is_none(), - Either::Left(ModuleDef::TypeAlias(type_alias)) => { - type_alias.as_assoc_item(ctx.db).is_none() - } - _ => true, - }) .filter_map(|import_candidate| { Some(match import_candidate { Either::Left(module_def) => { -- cgit v1.2.3