diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-08-09 17:44:47 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-08-14 16:37:09 +1000 |
| commit | 7923b20dd9587743372b3fdf7b48eae220200f6e (patch) | |
| tree | 9c6649ffab5d4b4b19337f75c925fda3d90a4671 /compiler/rustc_parse/src/lexer | |
| parent | bbcfd90cd17a5d8a812cf3dcf9e5197b72ddde4b (diff) | |
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.
Diffstat (limited to 'compiler/rustc_parse/src/lexer')
| -rw-r--r-- | compiler/rustc_parse/src/lexer/tokentrees.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/lexer/tokentrees.rs b/compiler/rustc_parse/src/lexer/tokentrees.rs index fb4ed5b93b2..e7a7105803f 100644 --- a/compiler/rustc_parse/src/lexer/tokentrees.rs +++ b/compiler/rustc_parse/src/lexer/tokentrees.rs @@ -229,7 +229,7 @@ impl<'psess, 'src> TokenTreesReader<'psess, 'src> { } else { let this_spacing = if next_tok.is_punct() { Spacing::Joint - } else if next_tok.kind == token::Eof { + } else if next_tok == token::Eof { Spacing::Alone } else { Spacing::JointHidden |
