about summary refs log tree commit diff
diff options
context:
space:
mode:
authorThe8472 <git@infinite-source.de>2021-11-08 19:29:16 +0100
committerThe8472 <git@infinite-source.de>2021-11-09 20:54:42 +0100
commita6e0aa20d90ee9173a6b901c641a8d48abbd82db (patch)
tree0141f8fa89c0bcd12d60b3e6ebc07174b7fbbdc5
parent7f6e080120fe3c2fd067a5b8d5df04b45ef78b09 (diff)
downloadrust-a6e0aa20d90ee9173a6b901c641a8d48abbd82db.tar.gz
rust-a6e0aa20d90ee9173a6b901c641a8d48abbd82db.zip
remove redundant .iter() call since zip() takes an IntoIterator argument
-rw-r--r--library/std/src/path.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/library/std/src/path.rs b/library/std/src/path.rs
index 33225692d17..7e1135365cd 100644
--- a/library/std/src/path.rs
+++ b/library/std/src/path.rs
@@ -1033,12 +1033,11 @@ fn compare_components(mut left: Components<'_>, mut right: Components<'_>) -> cm
     // the middle of one
     if left.prefix.is_none() && right.prefix.is_none() && left.front == right.front {
         // possible future improvement: a [u8]::first_mismatch simd implementation
-        let first_difference =
-            match left.path.iter().zip(right.path.iter()).position(|(&a, &b)| a != b) {
-                None if left.path.len() == right.path.len() => return cmp::Ordering::Equal,
-                None => left.path.len().min(right.path.len()),
-                Some(diff) => diff,
-            };
+        let first_difference = match left.path.iter().zip(right.path).position(|(&a, &b)| a != b) {
+            None if left.path.len() == right.path.len() => return cmp::Ordering::Equal,
+            None => left.path.len().min(right.path.len()),
+            Some(diff) => diff,
+        };
 
         if let Some(previous_sep) =
             left.path[..first_difference].iter().rposition(|&b| left.is_sep_byte(b))