Removed stable/unstable sort arg from into_sorted_stable_ord, fixed a few misc issues, added collect to UnordItems
This commit is contained in:
@@ -140,12 +140,12 @@ impl<T: Ord, I: Iterator<Item = T>> UnordItems<T, I> {
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn into_sorted_stable_ord(self, use_stable_sort: bool) -> Vec<T>
|
||||
pub fn into_sorted_stable_ord(self) -> Vec<T>
|
||||
where
|
||||
T: Ord + StableOrd,
|
||||
{
|
||||
let mut items: Vec<T> = self.0.collect();
|
||||
if use_stable_sort {
|
||||
if !T::CAN_USE_UNSTABLE_SORT {
|
||||
items.sort();
|
||||
} else {
|
||||
items.sort_unstable()
|
||||
@@ -161,6 +161,10 @@ impl<T: Ord, I: Iterator<Item = T>> UnordItems<T, I> {
|
||||
items.sort_by_cached_key(|x| x.to_stable_hash_key(hcx));
|
||||
items
|
||||
}
|
||||
|
||||
pub fn collect<C: From<UnordItems<T, I>>>(self) -> C {
|
||||
self.into()
|
||||
}
|
||||
}
|
||||
|
||||
/// This is a set collection type that tries very hard to not expose
|
||||
|
||||
Reference in New Issue
Block a user