Skip to content

Commit e46caaf

Browse files
committed
Simplify a match.
`may_be_ident` is true for `NtPath` and `NtMeta`, so we don't need to check for them separately.
1 parent 9a3c907 commit e46caaf

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

compiler/rustc_parse/src/parser/nonterminal.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,7 @@ impl<'a> Parser<'a> {
6464
},
6565
NonterminalKind::Path | NonterminalKind::Meta => match &token.kind {
6666
token::ModSep | token::Ident(..) => true,
67-
token::Interpolated(nt) => match **nt {
68-
NtPath(_) | NtMeta(_) => true,
69-
_ => may_be_ident(&nt),
70-
},
67+
token::Interpolated(nt) => may_be_ident(nt),
7168
_ => false,
7269
},
7370
NonterminalKind::PatParam { .. } | NonterminalKind::PatWithOr => {

0 commit comments

Comments
 (0)