From 0cd6a88cf6f80d48669c6136f5fa814fcdafe8e2 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Thu, 30 Apr 2020 00:10:15 +0200 Subject: if let -> match --- crates/ra_ide/src/completion/complete_qualified_path.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'crates/ra_ide/src') diff --git a/crates/ra_ide/src/completion/complete_qualified_path.rs b/crates/ra_ide/src/completion/complete_qualified_path.rs index 69e789a49..aa56a5cd8 100644 --- a/crates/ra_ide/src/completion/complete_qualified_path.rs +++ b/crates/ra_ide/src/completion/complete_qualified_path.rs @@ -15,10 +15,9 @@ pub(super) fn complete_qualified_path(acc: &mut Completions, ctx: &CompletionCon let scope = ctx.scope(); let context_module = scope.module(); - let res = if let Some(res) = scope.resolve_hir_path(&path) { - res - } else { - return; + let res = match scope.resolve_hir_path(&path) { + Some(res) => res, + None => return, }; // Add associated types on type parameters and `Self`. -- cgit v1.2.3