Skip to content

Commit a02ec4c

Browse files
author
Lukas Markeffsky
committed
remove HRTB from [T]::is_sorted_by{,_key}
1 parent e6ce562 commit a02ec4c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

library/core/src/slice/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -3724,9 +3724,9 @@ impl<T> [T] {
37243724
/// [`is_sorted`]: slice::is_sorted
37253725
#[unstable(feature = "is_sorted", reason = "new API", issue = "53485")]
37263726
#[must_use]
3727-
pub fn is_sorted_by<F>(&self, mut compare: F) -> bool
3727+
pub fn is_sorted_by<'a, F>(&'a self, mut compare: F) -> bool
37283728
where
3729-
F: FnMut(&T, &T) -> Option<Ordering>,
3729+
F: FnMut(&'a T, &'a T) -> Option<Ordering>,
37303730
{
37313731
self.iter().is_sorted_by(|a, b| compare(*a, *b))
37323732
}
@@ -3750,9 +3750,9 @@ impl<T> [T] {
37503750
#[inline]
37513751
#[unstable(feature = "is_sorted", reason = "new API", issue = "53485")]
37523752
#[must_use]
3753-
pub fn is_sorted_by_key<F, K>(&self, f: F) -> bool
3753+
pub fn is_sorted_by_key<'a, F, K>(&'a self, f: F) -> bool
37543754
where
3755-
F: FnMut(&T) -> K,
3755+
F: FnMut(&'a T) -> K,
37563756
K: PartialOrd,
37573757
{
37583758
self.iter().is_sorted_by_key(f)

0 commit comments

Comments
 (0)