into_sorted/unstable/
methods.rs1use super::functions::*;
2use core::cmp::Ordering;
3
4pub trait IntoSortedUnstable<Item>: crate::sealed::IsArray<Item> {
6 fn into_sorted_unstable(self) -> Self
12 where
13 Item: Ord;
14
15 fn into_sorted_unstable_by<Order>(self, order: Order) -> Self
21 where
22 Order: FnMut(&Item, &Item) -> Ordering;
23
24 fn into_sorted_unstable_by_key<Key, GetKey>(self, get_key: GetKey) -> Self
30 where
31 GetKey: FnMut(&Item) -> Key,
32 Key: Ord;
33}
34
35impl<Item, Array> IntoSortedUnstable<Item> for Array
36where
37 Array: AsMut<[Item]> + Sized,
38{
39 #[inline]
40 fn into_sorted_unstable(self) -> Self
41 where
42 Item: Ord,
43 {
44 into_sorted_unstable(self)
45 }
46
47 #[inline]
48 fn into_sorted_unstable_by<Order>(self, order: Order) -> Self
49 where
50 Order: FnMut(&Item, &Item) -> Ordering,
51 {
52 into_sorted_unstable_by(self, order)
53 }
54
55 #[inline]
56 fn into_sorted_unstable_by_key<Key, GetKey>(self, get_key: GetKey) -> Self
57 where
58 GetKey: FnMut(&Item) -> Key,
59 Key: Ord,
60 {
61 into_sorted_unstable_by_key(self, get_key)
62 }
63}