diff options
| author | Lukas Markeffsky <@> | 2022-10-12 18:39:22 +0200 |
|---|---|---|
| committer | Lukas Markeffsky <@> | 2022-10-12 18:39:22 +0200 |
| commit | a02ec4cf1817b6ec7f154e11521cb76507cd4a3c (patch) | |
| tree | f454debc0cbed756f7bdb52090ea03bb4875cce1 | |
| parent | e6ce5627a9e8af9ae4673a390954fffaf526e5cc (diff) | |
| download | rust-a02ec4cf1817b6ec7f154e11521cb76507cd4a3c.tar.gz rust-a02ec4cf1817b6ec7f154e11521cb76507cd4a3c.zip | |
remove HRTB from `[T]::is_sorted_by{,_key}`
| -rw-r--r-- | library/core/src/slice/mod.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/library/core/src/slice/mod.rs b/library/core/src/slice/mod.rs index 56133f346ae..e874b576368 100644 --- a/library/core/src/slice/mod.rs +++ b/library/core/src/slice/mod.rs @@ -3724,9 +3724,9 @@ impl<T> [T] { /// [`is_sorted`]: slice::is_sorted #[unstable(feature = "is_sorted", reason = "new API", issue = "53485")] #[must_use] - pub fn is_sorted_by<F>(&self, mut compare: F) -> bool + pub fn is_sorted_by<'a, F>(&'a self, mut compare: F) -> bool where - F: FnMut(&T, &T) -> Option<Ordering>, + F: FnMut(&'a T, &'a T) -> Option<Ordering>, { self.iter().is_sorted_by(|a, b| compare(*a, *b)) } @@ -3750,9 +3750,9 @@ impl<T> [T] { #[inline] #[unstable(feature = "is_sorted", reason = "new API", issue = "53485")] #[must_use] - pub fn is_sorted_by_key<F, K>(&self, f: F) -> bool + pub fn is_sorted_by_key<'a, F, K>(&'a self, f: F) -> bool where - F: FnMut(&T) -> K, + F: FnMut(&'a T) -> K, K: PartialOrd, { self.iter().is_sorted_by_key(f) |
