internal: Make block_def_map infallible

This commit is contained in:
Lukas Wirth 2023-04-14 12:15:48 +02:00
parent 10e0aaf284
commit c32d51979d
9 changed files with 32 additions and 60 deletions

View file

@ -210,13 +210,11 @@ impl TestDB {
});
for scope in scope_iter {
let containing_blocks =
let mut containing_blocks =
scopes.scope_chain(Some(scope)).filter_map(|scope| scopes.block(scope));
for block in containing_blocks {
if let Some(def_map) = self.block_def_map(block) {
return Some(def_map);
}
if let Some(block) = containing_blocks.next().map(|block| self.block_def_map(block)) {
return Some(block);
}
}