Replace if let with match where appropriate

This commit is contained in:
Aramis Razzaghipour
2021-10-03 23:53:01 +11:00
parent f29796da61
commit 9583dd5725
44 changed files with 201 additions and 269 deletions

View File

@@ -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),
}
}
}