aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_db
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-02-07 13:26:59 +0000
committerAleksey Kladov <[email protected]>2020-02-07 13:26:59 +0000
commitae70d072374f3c4d14abdccbe61661cf02b41b33 (patch)
tree7b4540f55d2cae95e2682920a6946736a22c351f /crates/ra_ide_db
parentf55be75a17dab2ca23b34c45e7597fe19a5fc8e4 (diff)
Rename
Diffstat (limited to 'crates/ra_ide_db')
-rw-r--r--crates/ra_ide_db/src/defs.rs8
-rw-r--r--crates/ra_ide_db/src/imports_locator.rs2
2 files changed, 5 insertions, 5 deletions
diff --git a/crates/ra_ide_db/src/defs.rs b/crates/ra_ide_db/src/defs.rs
index 0599f5e38..030f44f86 100644
--- a/crates/ra_ide_db/src/defs.rs
+++ b/crates/ra_ide_db/src/defs.rs
@@ -20,8 +20,8 @@ use crate::RootDatabase;
20#[derive(Debug, PartialEq, Eq)] 20#[derive(Debug, PartialEq, Eq)]
21pub enum NameKind { 21pub enum NameKind {
22 Macro(MacroDef), 22 Macro(MacroDef),
23 Field(StructField), 23 StructField(StructField),
24 Def(ModuleDef), 24 ModuleDef(ModuleDef),
25 SelfType(ImplBlock), 25 SelfType(ImplBlock),
26 Local(Local), 26 Local(Local),
27 TypeParam(TypeParam), 27 TypeParam(TypeParam),
@@ -130,7 +130,7 @@ pub fn classify_name(
130} 130}
131 131
132pub fn from_struct_field(db: &RootDatabase, field: StructField) -> NameDefinition { 132pub fn from_struct_field(db: &RootDatabase, field: StructField) -> NameDefinition {
133 let kind = NameKind::Field(field); 133 let kind = NameKind::StructField(field);
134 let parent = field.parent_def(db); 134 let parent = field.parent_def(db);
135 let container = parent.module(db); 135 let container = parent.module(db);
136 let visibility = match parent { 136 let visibility = match parent {
@@ -146,7 +146,7 @@ pub fn from_module_def(
146 def: ModuleDef, 146 def: ModuleDef,
147 module: Option<Module>, 147 module: Option<Module>,
148) -> NameDefinition { 148) -> NameDefinition {
149 let kind = NameKind::Def(def); 149 let kind = NameKind::ModuleDef(def);
150 let (container, visibility) = match def { 150 let (container, visibility) = match def {
151 ModuleDef::Module(it) => { 151 ModuleDef::Module(it) => {
152 let container = it.parent(db).or_else(|| Some(it)).unwrap(); 152 let container = it.parent(db).or_else(|| Some(it)).unwrap();
diff --git a/crates/ra_ide_db/src/imports_locator.rs b/crates/ra_ide_db/src/imports_locator.rs
index 401b8ac0b..86383bcd0 100644
--- a/crates/ra_ide_db/src/imports_locator.rs
+++ b/crates/ra_ide_db/src/imports_locator.rs
@@ -44,7 +44,7 @@ impl<'a> ImportsLocator<'a> {
44 .chain(lib_results.into_iter()) 44 .chain(lib_results.into_iter())
45 .filter_map(|import_candidate| self.get_name_definition(db, &import_candidate)) 45 .filter_map(|import_candidate| self.get_name_definition(db, &import_candidate))
46 .filter_map(|name_definition_to_import| match name_definition_to_import { 46 .filter_map(|name_definition_to_import| match name_definition_to_import {
47 NameKind::Def(module_def) => Some(module_def), 47 NameKind::ModuleDef(module_def) => Some(module_def),
48 _ => None, 48 _ => None,
49 }) 49 })
50 .collect() 50 .collect()