diff options
Diffstat (limited to 'crates/ra_hir/src/impl_block.rs')
-rw-r--r-- | crates/ra_hir/src/impl_block.rs | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/crates/ra_hir/src/impl_block.rs b/crates/ra_hir/src/impl_block.rs index c9a9fb99f..ab996a12c 100644 --- a/crates/ra_hir/src/impl_block.rs +++ b/crates/ra_hir/src/impl_block.rs | |||
@@ -3,7 +3,7 @@ use rustc_hash::FxHashMap; | |||
3 | 3 | ||
4 | use ra_arena::{Arena, RawId, impl_arena_id}; | 4 | use ra_arena::{Arena, RawId, impl_arena_id}; |
5 | use ra_syntax::ast::{self, AstNode}; | 5 | use ra_syntax::ast::{self, AstNode}; |
6 | use ra_db::{LocationIntener, Cancelable, SourceRootId}; | 6 | use ra_db::{LocationIntener, SourceRootId}; |
7 | 7 | ||
8 | use crate::{ | 8 | use crate::{ |
9 | DefId, DefLoc, DefKind, SourceItemId, SourceFileItems, | 9 | DefId, DefLoc, DefKind, SourceItemId, SourceFileItems, |
@@ -166,8 +166,8 @@ impl ModuleImplBlocks { | |||
166 | } | 166 | } |
167 | } | 167 | } |
168 | 168 | ||
169 | fn collect(&mut self, db: &impl HirDatabase, module: Module) -> Cancelable<()> { | 169 | fn collect(&mut self, db: &impl HirDatabase, module: Module) { |
170 | let (file_id, module_source) = module.definition_source(db)?; | 170 | let (file_id, module_source) = module.definition_source(db); |
171 | let node = match &module_source { | 171 | let node = match &module_source { |
172 | ModuleSource::SourceFile(node) => node.syntax(), | 172 | ModuleSource::SourceFile(node) => node.syntax(), |
173 | ModuleSource::Module(node) => node | 173 | ModuleSource::Module(node) => node |
@@ -185,8 +185,6 @@ impl ModuleImplBlocks { | |||
185 | self.impls_by_def.insert(impl_item.def_id(), id); | 185 | self.impls_by_def.insert(impl_item.def_id(), id); |
186 | } | 186 | } |
187 | } | 187 | } |
188 | |||
189 | Ok(()) | ||
190 | } | 188 | } |
191 | } | 189 | } |
192 | 190 | ||
@@ -194,9 +192,9 @@ pub(crate) fn impls_in_module( | |||
194 | db: &impl HirDatabase, | 192 | db: &impl HirDatabase, |
195 | source_root_id: SourceRootId, | 193 | source_root_id: SourceRootId, |
196 | module_id: ModuleId, | 194 | module_id: ModuleId, |
197 | ) -> Cancelable<Arc<ModuleImplBlocks>> { | 195 | ) -> Arc<ModuleImplBlocks> { |
198 | let mut result = ModuleImplBlocks::new(); | 196 | let mut result = ModuleImplBlocks::new(); |
199 | let module = Module::from_module_id(db, source_root_id, module_id); | 197 | let module = Module::from_module_id(db, source_root_id, module_id); |
200 | result.collect(db, module)?; | 198 | result.collect(db, module); |
201 | Ok(Arc::new(result)) | 199 | Arc::new(result) |
202 | } | 200 | } |