use matches! macro in more places
This commit is contained in:
parent
e6e956dade
commit
bcc15bba95
13 changed files with 52 additions and 75 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue