3010: minor, if let else -> match r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
bors[bot] 2020-02-04 12:42:32 +00:00 committed by GitHub
commit 2cfba36deb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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()
}