diff options
Diffstat (limited to 'library/core/src')
| -rw-r--r-- | library/core/src/slice/iter.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/library/core/src/slice/iter.rs b/library/core/src/slice/iter.rs index c4317799bcc..68c7c5f23c9 100644 --- a/library/core/src/slice/iter.rs +++ b/library/core/src/slice/iter.rs @@ -132,9 +132,7 @@ iterator! {struct Iter -> *const T, &'a T, const, {/* no mut */}, { Self: Sized, F: FnMut(&Self::Item, &Self::Item) -> Option<Ordering>, { - self.as_slice().windows(2).all(|w| { - compare(&&w[0], &&w[1]).map(|o| o != Ordering::Greater).unwrap_or(false) - }) + self.as_slice().array_windows().all(|[a, b]| compare(&a, &b).map_or(false, Ordering::is_le)) } }} |
