defining_crate -> krate
This commit is contained in:
parent
e0e9c6d1a4
commit
86fbd8cc2b
@ -128,7 +128,7 @@ pub(crate) fn find_path_inner(
|
||||
let mut best_path = None;
|
||||
let mut best_path_len = max_len;
|
||||
|
||||
if item.defining_crate(db) == Some(from.krate) {
|
||||
if item.krate(db) == Some(from.krate) {
|
||||
// Item was defined in the same crate that wants to import it. It cannot be found in any
|
||||
// dependency in this case.
|
||||
|
||||
|
@ -205,7 +205,8 @@ impl ItemInNs {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn defining_crate(&self, db: &dyn DefDatabase) -> Option<CrateId> {
|
||||
/// Returns the crate defining this item (or `None` if `self` is built-in).
|
||||
pub fn krate(&self, db: &dyn DefDatabase) -> Option<CrateId> {
|
||||
Some(match self {
|
||||
ItemInNs::Types(did) | ItemInNs::Values(did) => match did {
|
||||
ModuleDefId::ModuleId(id) => id.krate,
|
||||
|
Loading…
x
Reference in New Issue
Block a user