Skip to content

Commit 1d4a419

Browse files
committed
rustc_hir: don't open-code Iterator::eq
1 parent 3802225 commit 1d4a419

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

compiler/rustc_hir/src/hir.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -1101,10 +1101,7 @@ impl AttributeExt for Attribute {
11011101

11021102
fn path_matches(&self, name: &[Symbol]) -> bool {
11031103
match &self.kind {
1104-
AttrKind::Normal(n) => {
1105-
n.path.segments.len() == name.len()
1106-
&& n.path.segments.iter().zip(name).all(|(s, n)| s.name == *n)
1107-
}
1104+
AttrKind::Normal(n) => n.path.segments.iter().map(|segment| &segment.name).eq(name),
11081105
AttrKind::DocComment(..) => false,
11091106
}
11101107
}

0 commit comments

Comments
 (0)