about summary refs log tree commit diff
path: root/compiler/rustc_hir/src
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_hir/src
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_hir/src')
-rw-r--r--compiler/rustc_hir/src/hir.rs5
1 files changed, 1 insertions, 4 deletions
diff --git a/compiler/rustc_hir/src/hir.rs b/compiler/rustc_hir/src/hir.rs
index 493236718a8..bc1c47e95c3 100644
--- a/compiler/rustc_hir/src/hir.rs
+++ b/compiler/rustc_hir/src/hir.rs
@@ -1298,10 +1298,7 @@ impl AttributeExt for Attribute {
     #[inline]
     fn path_matches(&self, name: &[Symbol]) -> bool {
         match &self {
-            Attribute::Unparsed(n) => {
-                n.path.segments.len() == name.len()
-                    && n.path.segments.iter().zip(name).all(|(s, n)| s.name == *n)
-            }
+            Attribute::Unparsed(n) => n.path.segments.iter().map(|ident| &ident.name).eq(name),
             _ => false,
         }
     }