From 8ebb20edce85b74eab0ed78ba5c4969ec733ad12 Mon Sep 17 00:00:00 2001 From: Marco Groppo Date: Wed, 17 Apr 2019 23:40:00 +0200 Subject: New krate() method in Resolver. Renamed Impl to ImplBlock. --- crates/ra_ide_api/src/completion/complete_path.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 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 c49147b9e..c41752ae7 100644 --- a/crates/ra_ide_api/src/completion/complete_path.rs +++ b/crates/ra_ide_api/src/completion/complete_path.rs @@ -39,7 +39,7 @@ pub(super) fn complete_path(acc: &mut Completions, ctx: &CompletionContext) { hir::ModuleDef::Struct(s) => { let ty = s.ty(ctx.db); let krate = ctx.module.and_then(|m| m.krate(ctx.db)); - krate.map_or((), |krate| { + if let Some(krate) = krate { ty.iterate_impl_items(ctx.db, krate, |item| { match item { hir::ImplItem::Method(func) => { @@ -53,7 +53,7 @@ pub(super) fn complete_path(acc: &mut Completions, ctx: &CompletionContext) { } None::<()> }); - }); + } } _ => return, }; -- cgit v1.2.3