Use impl PartialEq<TokenKind> for Token
more.
This lets us compare a `Token` with a `TokenKind`. It's used a lot, but can be used even more, avoiding the need for some `.kind` uses.
This commit is contained in:
parent
bbcfd90cd1
commit
7923b20dd9
16 changed files with 121 additions and 128 deletions
|
@ -1154,7 +1154,7 @@ fn check_matcher_core<'tt>(
|
|||
&& matches!(kind, NonterminalKind::Pat(PatParam { inferred: true }))
|
||||
&& matches!(
|
||||
next_token,
|
||||
TokenTree::Token(token) if token.kind == BinOp(token::BinOpToken::Or)
|
||||
TokenTree::Token(token) if *token == BinOp(token::BinOpToken::Or)
|
||||
)
|
||||
{
|
||||
// It is suggestion to use pat_param, for example: $x:pat -> $x:pat_param.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue