From a6590ce2318676210b6b5a197b76b5861a3407c9 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Tue, 8 Jan 2019 00:30:49 +0100 Subject: Use name resolution for goto definition --- crates/ra_ide_api/src/completion/complete_path.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/ra_ide_api/src/completion') diff --git a/crates/ra_ide_api/src/completion/complete_path.rs b/crates/ra_ide_api/src/completion/complete_path.rs index 4860db629..a25ad3f13 100644 --- a/crates/ra_ide_api/src/completion/complete_path.rs +++ b/crates/ra_ide_api/src/completion/complete_path.rs @@ -15,11 +15,11 @@ pub(super) fn complete_path(acc: &mut Completions, ctx: &CompletionContext) -> C match def_id.resolve(ctx.db)? { hir::Def::Module(module) => { let module_scope = module.scope(ctx.db)?; - module_scope.entries().for_each(|(name, res)| { + for (name, res) in module_scope.entries() { CompletionItem::new(CompletionKind::Reference, name.to_string()) .from_resolution(ctx, res) - .add_to(acc) - }); + .add_to(acc); + } } hir::Def::Enum(e) => { e.variants(ctx.db)? -- cgit v1.2.3