mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-28 22:34:17 +00:00
Replace if let
with match
where appropriate
This commit is contained in:
parent
f29796da61
commit
9583dd5725
44 changed files with 201 additions and 269 deletions
|
@ -549,10 +549,9 @@ impl ast::FieldExpr {
|
|||
}
|
||||
|
||||
pub fn field_access(&self) -> Option<FieldKind> {
|
||||
if let Some(nr) = self.name_ref() {
|
||||
Some(FieldKind::Name(nr))
|
||||
} else {
|
||||
self.index_token().map(FieldKind::Index)
|
||||
match self.name_ref() {
|
||||
Some(nr) => Some(FieldKind::Name(nr)),
|
||||
None => self.index_token().map(FieldKind::Index),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue