mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
Simplify
This commit is contained in:
parent
301711ee71
commit
fbc1d2a514
4 changed files with 38 additions and 35 deletions
|
@ -1327,14 +1327,14 @@ impl<'a> SemanticsScope<'a> {
|
|||
resolver::ScopeDef::ImplSelfType(it) => ScopeDef::ImplSelfType(it.into()),
|
||||
resolver::ScopeDef::AdtSelfType(it) => ScopeDef::AdtSelfType(it.into()),
|
||||
resolver::ScopeDef::GenericParam(id) => ScopeDef::GenericParam(id.into()),
|
||||
resolver::ScopeDef::Local(pat_id) => {
|
||||
let parent = self.resolver.body_owner().unwrap();
|
||||
ScopeDef::Local(Local { parent, pat_id })
|
||||
}
|
||||
resolver::ScopeDef::Label(label_id) => {
|
||||
let parent = self.resolver.body_owner().unwrap();
|
||||
ScopeDef::Label(Label { parent, label_id })
|
||||
}
|
||||
resolver::ScopeDef::Local(pat_id) => match self.resolver.body_owner() {
|
||||
Some(parent) => ScopeDef::Local(Local { parent, pat_id }),
|
||||
None => continue,
|
||||
},
|
||||
resolver::ScopeDef::Label(label_id) => match self.resolver.body_owner() {
|
||||
Some(parent) => ScopeDef::Label(Label { parent, label_id }),
|
||||
None => continue,
|
||||
},
|
||||
};
|
||||
f(name.clone(), def)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue