mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 13:51:31 +00:00
remove Cancelable from Crate API
This commit is contained in:
parent
c159e414b4
commit
8af9a18660
4 changed files with 10 additions and 10 deletions
|
@ -1,4 +1,4 @@
|
|||
use ra_db::{CrateId, Cancelable};
|
||||
use ra_db::CrateId;
|
||||
|
||||
use crate::{
|
||||
HirFileId, Crate, CrateDependency, AsName, DefLoc, DefKind, Module, SourceItemId,
|
||||
|
@ -20,7 +20,7 @@ impl Crate {
|
|||
})
|
||||
.collect()
|
||||
}
|
||||
pub(crate) fn root_module_impl(&self, db: &impl HirDatabase) -> Cancelable<Option<Module>> {
|
||||
pub(crate) fn root_module_impl(&self, db: &impl HirDatabase) -> Option<Module> {
|
||||
let crate_graph = db.crate_graph();
|
||||
let file_id = crate_graph.crate_root(self.crate_id);
|
||||
let source_root_id = db.file_source_root(file_id);
|
||||
|
@ -31,7 +31,7 @@ impl Crate {
|
|||
file_id,
|
||||
item_id: None,
|
||||
};
|
||||
let module_id = ctry!(module_tree.find_module_by_source(source));
|
||||
let module_id = module_tree.find_module_by_source(source)?;
|
||||
|
||||
let def_loc = DefLoc {
|
||||
kind: DefKind::Module,
|
||||
|
@ -42,6 +42,6 @@ impl Crate {
|
|||
let def_id = def_loc.id(db);
|
||||
|
||||
let module = Module::new(def_id);
|
||||
Ok(Some(module))
|
||||
Some(module)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue