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
8 where
9 Item: Ord;
10
11 fn into_sorted_unstable_by<Order>(self, order: Order) -> Self
13 where
14 Order: FnMut(&Item, &Item) -> Ordering;
15
16 fn into_sorted_unstable_by_key<Key, GetKey>(self, get_key: GetKey) -> Self
18 where
19 GetKey: FnMut(&Item) -> Key,
20 Key: Ord;
21}
22
23impl<Item, Array> IntoSortedUnstable<Item> for Array
24where
25 Array: AsMut<[Item]> + Sized,
26{
27 #[inline]
28 fn into_sorted_unstable(self) -> Self
29 where
30 Item: Ord,
31 {
32 into_sorted_unstable(self)
33 }
34
35 #[inline]
36 fn into_sorted_unstable_by<Order>(self, order: Order) -> Self
37 where
38 Order: FnMut(&Item, &Item) -> Ordering,
39 {
40 into_sorted_unstable_by(self, order)
41 }
42
43 #[inline]
44 fn into_sorted_unstable_by_key<Key, GetKey>(self, get_key: GetKey) -> Self
45 where
46 GetKey: FnMut(&Item) -> Key,
47 Key: Ord,
48 {
49 into_sorted_unstable_by_key(self, get_key)
50 }
51}