From 3796efb01b42ba897649112c6f621c039448e7b2 Mon Sep 17 00:00:00 2001 From: raldone01 Date: Thu, 22 Sep 2022 12:38:37 +0200 Subject: [PATCH] Remove lifetimes. --- const_sort_rs/src/const_slice_sort_ext.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/const_sort_rs/src/const_slice_sort_ext.rs b/const_sort_rs/src/const_slice_sort_ext.rs index af6d5c4..dc1aa5f 100644 --- a/const_sort_rs/src/const_slice_sort_ext.rs +++ b/const_sort_rs/src/const_slice_sort_ext.rs @@ -378,7 +378,7 @@ pub trait ConstSliceSortExt { #[must_use] fn const_is_sorted_by(&self, compare: F) -> bool where - F: for<'a> FnMut(&'a T, &'a T) -> Option; + F: FnMut(&T, &T) -> Option; /// 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 @@ -522,7 +522,7 @@ impl const ConstSliceSortExt for [T] { } fn const_is_sorted_by(&self, mut compare: F) -> bool where - for<'a> F: ~const FnMut(&'a T, &'a T) -> Option + ~const Destruct, + F: ~const FnMut(&T, &T) -> Option + ~const Destruct, { // https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3794 let mut i = 1; @@ -544,13 +544,13 @@ impl const ConstSliceSortExt 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( f: &mut F, - (a, b): (&'a T, &'a T), + (a, b): (&T, &T), ) -> Option 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()