about summary refs log tree commit diff
path: root/compiler/rustc_ast/src/ast.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/ast.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/ast.rs')
-rw-r--r--compiler/rustc_ast/src/ast.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/compiler/rustc_ast/src/ast.rs b/compiler/rustc_ast/src/ast.rs
index 3e8fddd9954..082d5e88ac7 100644
--- a/compiler/rustc_ast/src/ast.rs
+++ b/compiler/rustc_ast/src/ast.rs
@@ -114,8 +114,7 @@ impl PartialEq<Symbol> for Path {
 impl PartialEq<&[Symbol]> for Path {
     #[inline]
     fn eq(&self, names: &&[Symbol]) -> bool {
-        self.segments.len() == names.len()
-            && self.segments.iter().zip(names.iter()).all(|(s1, s2)| s1 == s2)
+        self.segments.iter().eq(*names)
     }
 }