diff options
Diffstat (limited to 'crates/ra_hir/src/code_model.rs')
-rw-r--r-- | crates/ra_hir/src/code_model.rs | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index 9e4aa6022..c5cfd875f 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs | |||
@@ -143,17 +143,6 @@ impl ModuleDef { | |||
143 | } | 143 | } |
144 | } | 144 | } |
145 | 145 | ||
146 | impl From<ModuleDef> for ItemInNs { | ||
147 | fn from(module_def: ModuleDef) -> Self { | ||
148 | match module_def { | ||
149 | ModuleDef::Static(_) | ModuleDef::Const(_) | ModuleDef::Function(_) => { | ||
150 | ItemInNs::Values(module_def.into()) | ||
151 | } | ||
152 | _ => ItemInNs::Types(module_def.into()), | ||
153 | } | ||
154 | } | ||
155 | } | ||
156 | |||
157 | pub use hir_def::{ | 146 | pub use hir_def::{ |
158 | attr::Attrs, item_scope::ItemInNs, visibility::Visibility, AssocItemId, AssocItemLoc, | 147 | attr::Attrs, item_scope::ItemInNs, visibility::Visibility, AssocItemId, AssocItemLoc, |
159 | }; | 148 | }; |
@@ -290,9 +279,9 @@ impl Module { | |||
290 | pub fn find_use_path( | 279 | pub fn find_use_path( |
291 | self, | 280 | self, |
292 | db: &dyn DefDatabase, | 281 | db: &dyn DefDatabase, |
293 | item: ItemInNs, | 282 | item: impl Into<ItemInNs>, |
294 | ) -> Option<hir_def::path::ModPath> { | 283 | ) -> Option<hir_def::path::ModPath> { |
295 | hir_def::find_path::find_path(db, item, self.into()) | 284 | hir_def::find_path::find_path(db, item.into(), self.into()) |
296 | } | 285 | } |
297 | } | 286 | } |
298 | 287 | ||
@@ -764,12 +753,6 @@ impl MacroDef { | |||
764 | } | 753 | } |
765 | } | 754 | } |
766 | 755 | ||
767 | impl From<MacroDef> for ItemInNs { | ||
768 | fn from(macro_def: MacroDef) -> Self { | ||
769 | ItemInNs::Macros(macro_def.into()) | ||
770 | } | ||
771 | } | ||
772 | |||
773 | /// Invariant: `inner.as_assoc_item(db).is_some()` | 756 | /// Invariant: `inner.as_assoc_item(db).is_some()` |
774 | /// We do not actively enforce this invariant. | 757 | /// We do not actively enforce this invariant. |
775 | #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] | 758 | #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] |