mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
simplify
This commit is contained in:
parent
5299a35e3d
commit
1a860dba38
1 changed files with 4 additions and 9 deletions
|
@ -13,8 +13,8 @@ use ra_db::{SourceRootId, FileId, Cancelable};
|
||||||
use relative_path::RelativePathBuf;
|
use relative_path::RelativePathBuf;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
DefKind, DefLoc, DefId, Path, PathKind, HirDatabase, SourceItemId, SourceFileItemId, Crate,
|
Def, DefKind, DefLoc, DefId,
|
||||||
Name,
|
Name, Path, PathKind, HirDatabase, SourceItemId, SourceFileItemId, Crate,
|
||||||
arena::{Arena, Id},
|
arena::{Arena, Id},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -139,13 +139,8 @@ impl Module {
|
||||||
} else {
|
} else {
|
||||||
return Ok(PerNs::none());
|
return Ok(PerNs::none());
|
||||||
};
|
};
|
||||||
let module = match curr.loc(db) {
|
let module = match curr.resolve(db)? {
|
||||||
DefLoc {
|
Def::Module(it) => it,
|
||||||
kind: DefKind::Module,
|
|
||||||
source_root_id,
|
|
||||||
module_id,
|
|
||||||
..
|
|
||||||
} => Module::new(db, source_root_id, module_id)?,
|
|
||||||
// TODO here would be the place to handle enum variants...
|
// TODO here would be the place to handle enum variants...
|
||||||
_ => return Ok(PerNs::none()),
|
_ => return Ok(PerNs::none()),
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue