diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-03-02 18:09:00 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-03-02 18:09:00 +0000 |
commit | a484e9c7307377ffdf55ac25b9622dee14a97453 (patch) | |
tree | f9e743486294d96068f462e5a5a82508c5d873c4 /crates/ra_ide | |
parent | 7928ac4bbd8c75ac779d6da7e9cbe6aa314fb5bd (diff) | |
parent | 1a6f51da66f16a46eb5fd80dc6ea0a2c179d5ff2 (diff) |
Merge #3406
3406: Simplify: remove couple of useless functions r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_ide')
-rw-r--r-- | crates/ra_ide/src/references/classify.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/crates/ra_ide/src/references/classify.rs b/crates/ra_ide/src/references/classify.rs index e837ca8a3..571236fdc 100644 --- a/crates/ra_ide/src/references/classify.rs +++ b/crates/ra_ide/src/references/classify.rs | |||
@@ -7,8 +7,6 @@ use ra_prof::profile; | |||
7 | use ra_syntax::{ast, AstNode}; | 7 | use ra_syntax::{ast, AstNode}; |
8 | use test_utils::tested_by; | 8 | use test_utils::tested_by; |
9 | 9 | ||
10 | pub use ra_ide_db::defs::{from_module_def, from_struct_field}; | ||
11 | |||
12 | pub enum NameRefClass { | 10 | pub enum NameRefClass { |
13 | NameDefinition(NameDefinition), | 11 | NameDefinition(NameDefinition), |
14 | FieldShorthand { local: Local, field: NameDefinition }, | 12 | FieldShorthand { local: Local, field: NameDefinition }, |
@@ -68,14 +66,14 @@ pub(crate) fn classify_name_ref( | |||
68 | let path = name_ref.syntax().ancestors().find_map(ast::Path::cast)?; | 66 | let path = name_ref.syntax().ancestors().find_map(ast::Path::cast)?; |
69 | let resolved = sema.resolve_path(&path)?; | 67 | let resolved = sema.resolve_path(&path)?; |
70 | let res = match resolved { | 68 | let res = match resolved { |
71 | PathResolution::Def(def) => from_module_def(def), | 69 | PathResolution::Def(def) => NameDefinition::ModuleDef(def), |
72 | PathResolution::AssocItem(item) => { | 70 | PathResolution::AssocItem(item) => { |
73 | let def = match item { | 71 | let def = match item { |
74 | hir::AssocItem::Function(it) => it.into(), | 72 | hir::AssocItem::Function(it) => it.into(), |
75 | hir::AssocItem::Const(it) => it.into(), | 73 | hir::AssocItem::Const(it) => it.into(), |
76 | hir::AssocItem::TypeAlias(it) => it.into(), | 74 | hir::AssocItem::TypeAlias(it) => it.into(), |
77 | }; | 75 | }; |
78 | from_module_def(def) | 76 | NameDefinition::ModuleDef(def) |
79 | } | 77 | } |
80 | PathResolution::Local(local) => NameDefinition::Local(local), | 78 | PathResolution::Local(local) => NameDefinition::Local(local), |
81 | PathResolution::TypeParam(par) => NameDefinition::TypeParam(par), | 79 | PathResolution::TypeParam(par) => NameDefinition::TypeParam(par), |