@@ -2540,7 +2540,7 @@ impl<T> [T] {
2540
2540
where
2541
2541
T : Ord ,
2542
2542
{
2543
- sort:: quicksort ( self , |a , b| a . lt ( b ) ) ;
2543
+ sort:: quicksort ( self , T :: lt ) ;
2544
2544
}
2545
2545
2546
2546
/// Sorts the slice with a comparator function, but might not preserve the order of equal
@@ -2679,8 +2679,7 @@ impl<T> [T] {
2679
2679
where
2680
2680
T : Ord ,
2681
2681
{
2682
- let mut f = |a : & T , b : & T | a. lt ( b) ;
2683
- sort:: partition_at_index ( self , index, & mut f)
2682
+ sort:: partition_at_index ( self , index, T :: lt)
2684
2683
}
2685
2684
2686
2685
/// Reorder the slice with a comparator function such that the element at `index` is at its
@@ -2731,8 +2730,7 @@ impl<T> [T] {
2731
2730
where
2732
2731
F : FnMut ( & T , & T ) -> Ordering ,
2733
2732
{
2734
- let mut f = |a : & T , b : & T | compare ( a, b) == Less ;
2735
- sort:: partition_at_index ( self , index, & mut f)
2733
+ sort:: partition_at_index ( self , index, |a : & T , b : & T | compare ( a, b) == Less )
2736
2734
}
2737
2735
2738
2736
/// Reorder the slice with a key extraction function such that the element at `index` is at its
@@ -2784,8 +2782,7 @@ impl<T> [T] {
2784
2782
F : FnMut ( & T ) -> K ,
2785
2783
K : Ord ,
2786
2784
{
2787
- let mut g = |a : & T , b : & T | f ( a) . lt ( & f ( b) ) ;
2788
- sort:: partition_at_index ( self , index, & mut g)
2785
+ sort:: partition_at_index ( self , index, |a : & T , b : & T | f ( a) . lt ( & f ( b) ) )
2789
2786
}
2790
2787
2791
2788
/// Moves all consecutive repeated elements to the end of the slice according to the
0 commit comments