Simplify a match.

`may_be_ident` is true for `NtPath` and `NtMeta`, so we don't need to
check for them separately.
This commit is contained in:
Nicholas Nethercote 2023-08-11 09:36:51 +10:00
parent 9a3c907bdb
commit e46caaf84b

View File

@ -64,10 +64,7 @@ impl<'a> Parser<'a> {
},
NonterminalKind::Path | NonterminalKind::Meta => match &token.kind {
token::ModSep | token::Ident(..) => true,
token::Interpolated(nt) => match **nt {
NtPath(_) | NtMeta(_) => true,
_ => may_be_ident(&nt),
},
token::Interpolated(nt) => may_be_ident(nt),
_ => false,
},
NonterminalKind::PatParam { .. } | NonterminalKind::PatWithOr => {