Rollup merge of #129065 - nnethercote:PartialEq-TokenKind, r=spastorino

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.

r? `@spastorino`
This commit is contained in:
Matthias Krüger 2024-08-15 19:32:35 +02:00 committed by GitHub
commit bb63d75ac1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 122 additions and 129 deletions

View file

@ -1853,7 +1853,7 @@ impl KeywordIdents {
if !prev_dollar {
self.check_ident_token(cx, UnderMacro(true), ident);
}
} else if token.kind == TokenKind::Dollar {
} else if *token == TokenKind::Dollar {
prev_dollar = true;
continue;
}