Skip to content

Commit

Permalink
Remove lifetimes.
Browse files Browse the repository at this point in the history
  • Loading branch information
raldone01 committed Sep 22, 2022
1 parent c4506df commit 3796efb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions const_sort_rs/src/const_slice_sort_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ pub trait ConstSliceSortExt<T> {
#[must_use]
fn const_is_sorted_by<F>(&self, compare: F) -> bool
where
F: for<'a> FnMut(&'a T, &'a T) -> Option<Ordering>;
F: FnMut(&T, &T) -> Option<Ordering>;
/// Checks if the elements of this slice are sorted using the given key extraction function.
///
/// Instead of comparing the slice's elements directly, this function compares the keys of the
Expand Down Expand Up @@ -522,7 +522,7 @@ impl<T: ~const Destruct> const ConstSliceSortExt<T> for [T] {
}
fn const_is_sorted_by<F>(&self, mut compare: F) -> bool
where
for<'a> F: ~const FnMut(&'a T, &'a T) -> Option<Ordering> + ~const Destruct,
F: ~const FnMut(&T, &T) -> Option<Ordering> + ~const Destruct,
{
// https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3794
let mut i = 1;
Expand All @@ -544,13 +544,13 @@ impl<T: ~const Destruct> const ConstSliceSortExt<T> for [T] {
F: ~const FnMut(&T) -> K + ~const Destruct,
K: ~const PartialOrd + ~const Destruct,
{
const fn imp<'a, T, F, K: ~const PartialOrd + ~const Destruct>(
const fn imp<T, F, K: ~const PartialOrd + ~const Destruct>(
f: &mut F,
(a, b): (&'a T, &'a T),
(a, b): (&T, &T),
) -> Option<core::cmp::Ordering>
where
T: ~const Destruct,
for<'r> F: ~const FnMut(&'r T) -> K + ~const Destruct,
F: ~const FnMut(&T) -> K + ~const Destruct,
{
// https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3840
// self.map(f).is_sorted()
Expand Down

0 comments on commit 3796efb

Please sign in to comment.