diff options
Diffstat (limited to 'crates/ra_hir/src/code_model_impl')
-rw-r--r-- | crates/ra_hir/src/code_model_impl/krate.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_hir/src/code_model_impl/krate.rs b/crates/ra_hir/src/code_model_impl/krate.rs index 712c6c86a..8c6e34873 100644 --- a/crates/ra_hir/src/code_model_impl/krate.rs +++ b/crates/ra_hir/src/code_model_impl/krate.rs | |||
@@ -1,4 +1,4 @@ | |||
1 | use ra_db::{CrateId, Cancelable}; | 1 | use ra_db::CrateId; |
2 | 2 | ||
3 | use crate::{ | 3 | use crate::{ |
4 | HirFileId, Crate, CrateDependency, AsName, DefLoc, DefKind, Module, SourceItemId, | 4 | HirFileId, Crate, CrateDependency, AsName, DefLoc, DefKind, Module, SourceItemId, |
@@ -20,7 +20,7 @@ impl Crate { | |||
20 | }) | 20 | }) |
21 | .collect() | 21 | .collect() |
22 | } | 22 | } |
23 | pub(crate) fn root_module_impl(&self, db: &impl HirDatabase) -> Cancelable<Option<Module>> { | 23 | pub(crate) fn root_module_impl(&self, db: &impl HirDatabase) -> Option<Module> { |
24 | let crate_graph = db.crate_graph(); | 24 | let crate_graph = db.crate_graph(); |
25 | let file_id = crate_graph.crate_root(self.crate_id); | 25 | let file_id = crate_graph.crate_root(self.crate_id); |
26 | let source_root_id = db.file_source_root(file_id); | 26 | let source_root_id = db.file_source_root(file_id); |
@@ -31,7 +31,7 @@ impl Crate { | |||
31 | file_id, | 31 | file_id, |
32 | item_id: None, | 32 | item_id: None, |
33 | }; | 33 | }; |
34 | let module_id = ctry!(module_tree.find_module_by_source(source)); | 34 | let module_id = module_tree.find_module_by_source(source)?; |
35 | 35 | ||
36 | let def_loc = DefLoc { | 36 | let def_loc = DefLoc { |
37 | kind: DefKind::Module, | 37 | kind: DefKind::Module, |
@@ -42,6 +42,6 @@ impl Crate { | |||
42 | let def_id = def_loc.id(db); | 42 | let def_id = def_loc.id(db); |
43 | 43 | ||
44 | let module = Module::new(def_id); | 44 | let module = Module::new(def_id); |
45 | Ok(Some(module)) | 45 | Some(module) |
46 | } | 46 | } |
47 | } | 47 | } |