aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def/src/item_scope.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_def/src/item_scope.rs')
-rw-r--r--crates/ra_hir_def/src/item_scope.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/crates/ra_hir_def/src/item_scope.rs b/crates/ra_hir_def/src/item_scope.rs
index 87c50b34f..d74a1cef2 100644
--- a/crates/ra_hir_def/src/item_scope.rs
+++ b/crates/ra_hir_def/src/item_scope.rs
@@ -104,7 +104,7 @@ impl ItemScope {
104 } 104 }
105 } 105 }
106 106
107 pub(crate) fn reverse_get(&self, item: ItemInNs) -> Option<(&Name, Visibility)> { 107 pub(crate) fn name_of(&self, item: ItemInNs) -> Option<(&Name, Visibility)> {
108 for (name, per_ns) in &self.visible { 108 for (name, per_ns) in &self.visible {
109 if let Some(vis) = item.match_with(*per_ns) { 109 if let Some(vis) = item.match_with(*per_ns) {
110 return Some((name, vis)); 110 return Some((name, vis));
@@ -207,8 +207,7 @@ impl ItemInNs {
207 207
208 pub fn as_module_def_id(self) -> Option<ModuleDefId> { 208 pub fn as_module_def_id(self) -> Option<ModuleDefId> {
209 match self { 209 match self {
210 ItemInNs::Types(t) => Some(t), 210 ItemInNs::Types(id) | ItemInNs::Values(id) => Some(id),
211 ItemInNs::Values(v) => Some(v),
212 ItemInNs::Macros(_) => None, 211 ItemInNs::Macros(_) => None,
213 } 212 }
214 } 213 }