From 8af9a18660f9b2f34da902f43c1eef856af1cfca Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 15 Jan 2019 18:33:26 +0300 Subject: remove Cancelable from Crate API --- crates/ra_hir/src/code_model_impl/krate.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'crates/ra_hir/src/code_model_impl/krate.rs') 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 @@ -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> { + pub(crate) fn root_module_impl(&self, db: &impl HirDatabase) -> Option { 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) } } -- cgit v1.2.3