Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/method_resolution.rs')
-rw-r--r--crates/hir-ty/src/method_resolution.rs9
1 files changed, 3 insertions, 6 deletions
diff --git a/crates/hir-ty/src/method_resolution.rs b/crates/hir-ty/src/method_resolution.rs
index 740b6ddc27..9b8839f357 100644
--- a/crates/hir-ty/src/method_resolution.rs
+++ b/crates/hir-ty/src/method_resolution.rs
@@ -156,7 +156,7 @@ impl TraitImpls {
let _p = profile::span("trait_impls_in_block_query");
let mut impls = Self { map: FxHashMap::default() };
- let block_def_map = db.block_def_map(block)?;
+ let block_def_map = db.block_def_map(block);
impls.collect_def_map(db, &block_def_map);
impls.shrink_to_fit();
@@ -290,7 +290,7 @@ impl InherentImpls {
let _p = profile::span("inherent_impls_in_block_query");
let mut impls = Self { map: FxHashMap::default(), invalid_impls: Vec::default() };
- let block_def_map = db.block_def_map(block)?;
+ let block_def_map = db.block_def_map(block);
impls.collect_def_map(db, &block_def_map);
impls.shrink_to_fit();
@@ -1191,10 +1191,7 @@ fn iterate_inherent_methods(
)?;
}
- block = db
- .block_def_map(block_id)
- .and_then(|map| map.parent())
- .and_then(|module| module.containing_block());
+ block = db.block_def_map(block_id).parent().and_then(|module| module.containing_block());
}
for krate in def_crates {