mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 22:01:37 +00:00
internal: Make block_def_map infallible
This commit is contained in:
parent
10e0aaf284
commit
c32d51979d
9 changed files with 32 additions and 60 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue