From fafcd103d26821a8408572514201a40765bb2d2b Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 15 Jan 2019 19:18:52 +0300 Subject: remove Cancelable from ids --- crates/ra_hir/src/ty/method_resolution.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'crates/ra_hir/src/ty') diff --git a/crates/ra_hir/src/ty/method_resolution.rs b/crates/ra_hir/src/ty/method_resolution.rs index c7fbcfd06..94c5124a9 100644 --- a/crates/ra_hir/src/ty/method_resolution.rs +++ b/crates/ra_hir/src/ty/method_resolution.rs @@ -49,14 +49,14 @@ impl CrateImplBlocks { .into_iter() .flat_map(|i| i.iter()) .map(move |(module_id, impl_id)| { - let module_impl_blocks = db.impls_in_module(self.source_root_id, *module_id)?; + let module_impl_blocks = db.impls_in_module(self.source_root_id, *module_id); Ok(ImplBlock::from_id(module_impl_blocks, *impl_id)) }) } fn collect_recursive(&mut self, db: &impl HirDatabase, module: Module) -> Cancelable<()> { let module_id = module.def_id.loc(db).module_id; - let module_impl_blocks = db.impls_in_module(self.source_root_id, module_id)?; + let module_impl_blocks = db.impls_in_module(self.source_root_id, module_id); for (impl_id, impl_data) in module_impl_blocks.impls.iter() { let impl_block = ImplBlock::from_id(Arc::clone(&module_impl_blocks), impl_id); @@ -100,10 +100,10 @@ impl CrateImplBlocks { } } -fn def_crate(db: &impl HirDatabase, ty: &Ty) -> Cancelable> { +fn def_crate(db: &impl HirDatabase, ty: &Ty) -> Option { match ty { Ty::Adt { def_id, .. } => def_id.krate(db), - _ => Ok(None), + _ => None, } } @@ -139,7 +139,7 @@ impl Ty { // rustc does an autoderef and then autoref again). for derefed_ty in self.autoderef(db) { - let krate = match def_crate(db, &derefed_ty)? { + let krate = match def_crate(db, &derefed_ty) { Some(krate) => krate, None => continue, }; -- cgit v1.2.3