about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2023-08-11 09:36:51 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2023-08-17 09:06:03 +1000
commite46caaf84bcdfcbd7582b6ee63989f28116c3177 (patch)
treed604024868d76b8ab1e7b85efd471808d66e468e /compiler/rustc_parse/src/parser
parent9a3c907bdbab9c9e444db4c32997bf621936b891 (diff)
downloadrust-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.rs5
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 => {