aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Schievink <[email protected]>2020-06-05 12:05:19 +0100
committerJonas Schievink <[email protected]>2020-06-05 12:05:19 +0100
commit86fbd8cc2b71f473b9e6d41f4fe3e1a114f1f992 (patch)
treea597bf2b2440c321a1f3f57062a3afa0f48967fc
parente0e9c6d1a4cfdd4410b802ad8db1e29c9f1b4291 (diff)
defining_crate -> krate
-rw-r--r--crates/ra_hir_def/src/find_path.rs2
-rw-r--r--crates/ra_hir_def/src/item_scope.rs3
2 files changed, 3 insertions, 2 deletions
diff --git a/crates/ra_hir_def/src/find_path.rs b/crates/ra_hir_def/src/find_path.rs
index 79f4afab6..e6cd89478 100644
--- a/crates/ra_hir_def/src/find_path.rs
+++ b/crates/ra_hir_def/src/find_path.rs
@@ -128,7 +128,7 @@ pub(crate) fn find_path_inner(
128 let mut best_path = None; 128 let mut best_path = None;
129 let mut best_path_len = max_len; 129 let mut best_path_len = max_len;
130 130
131 if item.defining_crate(db) == Some(from.krate) { 131 if item.krate(db) == Some(from.krate) {
132 // Item was defined in the same crate that wants to import it. It cannot be found in any 132 // Item was defined in the same crate that wants to import it. It cannot be found in any
133 // dependency in this case. 133 // dependency in this case.
134 134
diff --git a/crates/ra_hir_def/src/item_scope.rs b/crates/ra_hir_def/src/item_scope.rs
index ede1aa045..d340e1f13 100644
--- a/crates/ra_hir_def/src/item_scope.rs
+++ b/crates/ra_hir_def/src/item_scope.rs
@@ -205,7 +205,8 @@ impl ItemInNs {
205 } 205 }
206 } 206 }
207 207
208 pub fn defining_crate(&self, db: &dyn DefDatabase) -> Option<CrateId> { 208 /// Returns the crate defining this item (or `None` if `self` is built-in).
209 pub fn krate(&self, db: &dyn DefDatabase) -> Option<CrateId> {
209 Some(match self { 210 Some(match self {
210 ItemInNs::Types(did) | ItemInNs::Values(did) => match did { 211 ItemInNs::Types(did) | ItemInNs::Values(did) => match did {
211 ModuleDefId::ModuleId(id) => id.krate, 212 ModuleDefId::ModuleId(id) => id.krate,