mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-17 02:08:30 +00:00
refactor: use parent instead ancestors for use alias
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
This commit is contained in:
parent
96f581079f
commit
e88c3e4fcd
1 changed files with 1 additions and 1 deletions
|
@ -121,7 +121,7 @@ fn classify_name_inner(sema: &Semantics<RootDatabase>, name: &ast::Name) -> Opti
|
|||
match parent {
|
||||
ast::Alias(it) => {
|
||||
tested_by!(goto_def_for_use_alias; force);
|
||||
let use_tree = it.syntax().ancestors().find_map(ast::UseTree::cast)?;
|
||||
let use_tree = it.syntax().parent().and_then(ast::UseTree::cast)?;
|
||||
let path = use_tree.path()?;
|
||||
let path_segment = path.segment()?;
|
||||
let name_ref = path_segment.name_ref()?;
|
||||
|
|
Loading…
Reference in a new issue