From 1376c5a617be5c25655d0d7cb63e3beaa5a6e026 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:20:39 +0200 Subject: Merging upstream version 1.70.0+dfsg1. Signed-off-by: Daniel Baumann --- library/core/src/slice/iter.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'library/core/src/slice/iter.rs') diff --git a/library/core/src/slice/iter.rs b/library/core/src/slice/iter.rs index c4317799b..88b84bd13 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, { - self.as_slice().windows(2).all(|w| { - compare(&&w[0], &&w[1]).map(|o| o != Ordering::Greater).unwrap_or(false) - }) + self.as_slice().is_sorted_by(|a, b| compare(&a, &b)) } }} -- cgit v1.2.3