diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-08-11 09:36:51 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-08-17 09:06:03 +1000 |
| commit | e46caaf84bcdfcbd7582b6ee63989f28116c3177 (patch) | |
| tree | d604024868d76b8ab1e7b85efd471808d66e468e /compiler/rustc_parse/src/parser | |
| parent | 9a3c907bdbab9c9e444db4c32997bf621936b891 (diff) | |
| download | rust-e46caaf84bcdfcbd7582b6ee63989f28116c3177.tar.gz rust-e46caaf84bcdfcbd7582b6ee63989f28116c3177.zip | |
Simplify a `match`.
`may_be_ident` is true for `NtPath` and `NtMeta`, so we don't need to check for them separately.
Diffstat (limited to 'compiler/rustc_parse/src/parser')
| -rw-r--r-- | compiler/rustc_parse/src/parser/nonterminal.rs | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/compiler/rustc_parse/src/parser/nonterminal.rs b/compiler/rustc_parse/src/parser/nonterminal.rs index 3862b7640b6..882ecc2a7ea 100644 --- a/compiler/rustc_parse/src/parser/nonterminal.rs +++ b/compiler/rustc_parse/src/parser/nonterminal.rs @@ -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 => { |
