about summary refs log tree commit diff
path: root/compiler/rustc_ast/src/tokenstream.rs
diff options
context:
space:
mode:
authorYotam Ofek <yotam.ofek@gmail.com>2025-09-27 20:57:50 +0300
committerYotam Ofek <yotam.ofek@gmail.com>2025-09-29 08:08:05 +0300
commit68a7c250788833305f73f816b284aafa9e62370a (patch)
treefc0eef15595f8d6272d6508ddbfe9c31c3fa5175 /compiler/rustc_ast/src/tokenstream.rs
parentf957826bff7a68b267ce75b1ea56352aed0cca0a (diff)
downloadrust-68a7c250788833305f73f816b284aafa9e62370a.tar.gz
rust-68a7c250788833305f73f816b284aafa9e62370a.zip
Use `Iterator::eq` and (dogfood) `eq_by` in compiler and library
Diffstat (limited to 'compiler/rustc_ast/src/tokenstream.rs')
-rw-r--r--compiler/rustc_ast/src/tokenstream.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/compiler/rustc_ast/src/tokenstream.rs b/compiler/rustc_ast/src/tokenstream.rs
index a5d8fbfac61..4111182c3b7 100644
--- a/compiler/rustc_ast/src/tokenstream.rs
+++ b/compiler/rustc_ast/src/tokenstream.rs
@@ -48,9 +48,7 @@ impl TokenTree {
         match (self, other) {
             (TokenTree::Token(token, _), TokenTree::Token(token2, _)) => token.kind == token2.kind,
             (TokenTree::Delimited(.., delim, tts), TokenTree::Delimited(.., delim2, tts2)) => {
-                delim == delim2
-                    && tts.len() == tts2.len()
-                    && tts.iter().zip(tts2.iter()).all(|(a, b)| a.eq_unspanned(b))
+                delim == delim2 && tts.iter().eq_by(tts2.iter(), |a, b| a.eq_unspanned(b))
             }
             _ => false,
         }