diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-05-04 13:37:41 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-05-04 13:37:41 +0100 |
commit | 580c5a969de541a3fa4b1678a04a61252afe94c1 (patch) | |
tree | 7413830a9f84747bf8bbec8780487259dc34fa28 /crates/ra_ide_db | |
parent | c12de4afbfd59d7f848589d564d03049409b7532 (diff) | |
parent | e88c3e4fcd5827e091a1cbc1b3d8ce4c67e09fe0 (diff) |
Merge #4297
4297: refactor: use parent instead ancestors for use alias r=matklad a=bnjjj
Linked to this comment https://github.com/rust-analyzer/rust-analyzer/pull/4269/files#r419343670
Co-authored-by: Benjamin Coenen <[email protected]>
Diffstat (limited to 'crates/ra_ide_db')
-rw-r--r-- | crates/ra_ide_db/src/defs.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/ra_ide_db/src/defs.rs b/crates/ra_ide_db/src/defs.rs index d5d06962b..40d0e77b5 100644 --- a/crates/ra_ide_db/src/defs.rs +++ b/crates/ra_ide_db/src/defs.rs | |||
@@ -121,7 +121,7 @@ fn classify_name_inner(sema: &Semantics<RootDatabase>, name: &ast::Name) -> Opti | |||
121 | match parent { | 121 | match parent { |
122 | ast::Alias(it) => { | 122 | ast::Alias(it) => { |
123 | tested_by!(goto_def_for_use_alias; force); | 123 | 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)?; |
125 | let path = use_tree.path()?; | 125 | let path = use_tree.path()?; |
126 | let path_segment = path.segment()?; | 126 | let path_segment = path.segment()?; |
127 | let name_ref = path_segment.name_ref()?; | 127 | let name_ref = path_segment.name_ref()?; |