diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/libcore/slice/mod.rs | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/src/libcore/slice/mod.rs b/src/libcore/slice/mod.rs index f972d13f7c3..ea4ea956e59 100644 --- a/src/libcore/slice/mod.rs +++ b/src/libcore/slice/mod.rs @@ -5294,13 +5294,7 @@ impl<A, B> SlicePartialEq<B> for [A] return false; } - for i in 0..self.len() { - if !self[i].eq(&other[i]) { - return false; - } - } - - true + self.iter().zip(other.iter()).all(|(x, y)| x == y) } } @@ -5317,13 +5311,7 @@ impl<A> SlicePartialEq<A> for [A] return true; } - for i in 0..self.len() { - if !self[i].eq(&other[i]) { - return false; - } - } - - true + self.iter().zip(other.iter()).all(|(x, y)| x == y) } } |
