Skip to content

Commit f8dde21

Browse files
committed
Simplify
1 parent aa571e3 commit f8dde21

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

crates/ra_ide/src/imports_locator.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use ra_prof::profile;
1111
use ra_syntax::{ast, AstNode, SyntaxKind::NAME};
1212

1313
use crate::{
14-
references::{classify_name, NameDefinition, NameKind},
14+
references::{classify_name, NameKind},
1515
Query,
1616
};
1717

@@ -28,7 +28,7 @@ impl<'a> ImportsLocatorIde<'a> {
2828
&mut self,
2929
db: &impl HirDatabase,
3030
import_candidate: &FileSymbol,
31-
) -> Option<NameDefinition> {
31+
) -> Option<NameKind> {
3232
let _p = profile("get_name_definition");
3333
let file_id = import_candidate.file_id.into();
3434
let candidate_node = import_candidate.ptr.to_node(&db.parse_or_expand(file_id)?);
@@ -41,6 +41,7 @@ impl<'a> ImportsLocatorIde<'a> {
4141
&mut self.source_binder,
4242
hir::InFile { file_id, value: &ast::Name::cast(candidate_name_node)? },
4343
)
44+
.map(|it| it.kind)
4445
}
4546
}
4647

@@ -67,7 +68,7 @@ impl ImportsLocator for ImportsLocatorIde<'_> {
6768
.into_iter()
6869
.chain(lib_results.into_iter())
6970
.filter_map(|import_candidate| self.get_name_definition(db, &import_candidate))
70-
.filter_map(|name_definition_to_import| match name_definition_to_import.kind {
71+
.filter_map(|name_definition_to_import| match name_definition_to_import {
7172
NameKind::Def(module_def) => Some(module_def),
7273
_ => None,
7374
})

0 commit comments

Comments
 (0)