use matches! macro in more places

This commit is contained in:
Matthias Krüger 2023-04-15 20:49:54 +02:00
parent e6e956dade
commit bcc15bba95
13 changed files with 52 additions and 75 deletions

View file

@ -20,12 +20,10 @@ impl<'a> Parser<'a> {
pub fn nonterminal_may_begin_with(kind: NonterminalKind, token: &Token) -> bool {
/// Checks whether the non-terminal may contain a single (non-keyword) identifier.
fn may_be_ident(nt: &token::Nonterminal) -> bool {
match *nt {
token::NtItem(_) | token::NtBlock(_) | token::NtVis(_) | token::NtLifetime(_) => {
false
}
_ => true,
}
!matches!(
*nt,
token::NtItem(_) | token::NtBlock(_) | token::NtVis(_) | token::NtLifetime(_)
)
}
match kind {