Skip to content

Commit e88c3e4

Browse files
committed
refactor: use parent instead ancestors for use alias
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
1 parent 96f5810 commit e88c3e4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/ra_ide_db/src/defs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ fn classify_name_inner(sema: &Semantics<RootDatabase>, name: &ast::Name) -> Opti
121121
match parent {
122122
ast::Alias(it) => {
123123
tested_by!(goto_def_for_use_alias; force);
124-
let use_tree = it.syntax().ancestors().find_map(ast::UseTree::cast)?;
124+
let use_tree = it.syntax().parent().and_then(ast::UseTree::cast)?;
125125
let path = use_tree.path()?;
126126
let path_segment = path.segment()?;
127127
let name_ref = path_segment.name_ref()?;

0 commit comments

Comments
 (0)