From e46caaf84bcdfcbd7582b6ee63989f28116c3177 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Fri, 11 Aug 2023 09:36:51 +1000 Subject: Simplify a `match`. `may_be_ident` is true for `NtPath` and `NtMeta`, so we don't need to check for them separately. --- compiler/rustc_parse/src/parser/nonterminal.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'compiler/rustc_parse/src') 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 => { -- cgit 1.4.1-3-g733a5