From f5a20014ce8787ebe4c910b9f0b4cf52d6130121 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 4 Feb 2020 13:41:56 +0100 Subject: minor, if let else -> match --- crates/ra_ide/src/imports_locator.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'crates') diff --git a/crates/ra_ide/src/imports_locator.rs b/crates/ra_ide/src/imports_locator.rs index 48b014c7d..9e1a1c1ec 100644 --- a/crates/ra_ide/src/imports_locator.rs +++ b/crates/ra_ide/src/imports_locator.rs @@ -64,12 +64,9 @@ impl ImportsLocator for ImportsLocatorIde<'_> { .into_iter() .chain(lib_results.into_iter()) .filter_map(|import_candidate| self.get_name_definition(db, &import_candidate)) - .filter_map(|name_definition_to_import| { - if let NameKind::Def(module_def) = name_definition_to_import.kind { - Some(module_def) - } else { - None - } + .filter_map(|name_definition_to_import| match name_definition_to_import.kind { + NameKind::Def(module_def) => Some(module_def), + _ => None, }) .collect() } -- cgit v1.2.3