Skip to content

Commit a6e0aa2

Browse files
committed
remove redundant .iter() call since zip() takes an IntoIterator argument
1 parent 7f6e080 commit a6e0aa2

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

library/std/src/path.rs

+5-6
Original file line numberDiff line numberDiff line change
@@ -1033,12 +1033,11 @@ fn compare_components(mut left: Components<'_>, mut right: Components<'_>) -> cm
10331033
// the middle of one
10341034
if left.prefix.is_none() && right.prefix.is_none() && left.front == right.front {
10351035
// possible future improvement: a [u8]::first_mismatch simd implementation
1036-
let first_difference =
1037-
match left.path.iter().zip(right.path.iter()).position(|(&a, &b)| a != b) {
1038-
None if left.path.len() == right.path.len() => return cmp::Ordering::Equal,
1039-
None => left.path.len().min(right.path.len()),
1040-
Some(diff) => diff,
1041-
};
1036+
let first_difference = match left.path.iter().zip(right.path).position(|(&a, &b)| a != b) {
1037+
None if left.path.len() == right.path.len() => return cmp::Ordering::Equal,
1038+
None => left.path.len().min(right.path.len()),
1039+
Some(diff) => diff,
1040+
};
10421041

10431042
if let Some(previous_sep) =
10441043
left.path[..first_difference].iter().rposition(|&b| left.is_sep_byte(b))

0 commit comments

Comments
 (0)