mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-13 13:48:50 +00:00
Merge #3010
3010: minor, if let else -> match r=matklad a=matklad Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
commit
2cfba36deb
1 changed files with 3 additions and 6 deletions
|
@ -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()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue