@@ -452,7 +452,7 @@ where
452
452
} ) ;
453
453
}
454
454
455
- /// Sort the set’s values in place and in parallel, using the comparison function `compare `.
455
+ /// Sort the set’s values in place and in parallel, using the comparison function `cmp `.
456
456
pub fn par_sort_by < F > ( & mut self , cmp : F )
457
457
where
458
458
F : Fn ( & T , & T ) -> Ordering + Sync ,
@@ -462,7 +462,7 @@ where
462
462
} ) ;
463
463
}
464
464
465
- /// Sort the values of the set in parallel and return a by value parallel iterator of
465
+ /// Sort the values of the set in parallel and return a by- value parallel iterator of
466
466
/// the values with the result.
467
467
pub fn par_sorted_by < F > ( self , cmp : F ) -> IntoParIter < T >
468
468
where
@@ -472,6 +472,37 @@ where
472
472
entries. par_sort_by ( move |a, b| cmp ( & a. key , & b. key ) ) ;
473
473
IntoParIter { entries }
474
474
}
475
+
476
+ /// Sort the set's values in parallel by their default ordering.
477
+ pub fn par_sort_unstable ( & mut self )
478
+ where
479
+ T : Ord ,
480
+ {
481
+ self . with_entries ( |entries| {
482
+ entries. par_sort_unstable_by ( |a, b| T :: cmp ( & a. key , & b. key ) ) ;
483
+ } ) ;
484
+ }
485
+
486
+ /// Sort the set’s values in place and in parallel, using the comparison function `cmp`.
487
+ pub fn par_sort_unstable_by < F > ( & mut self , cmp : F )
488
+ where
489
+ F : Fn ( & T , & T ) -> Ordering + Sync ,
490
+ {
491
+ self . with_entries ( |entries| {
492
+ entries. par_sort_unstable_by ( move |a, b| cmp ( & a. key , & b. key ) ) ;
493
+ } ) ;
494
+ }
495
+
496
+ /// Sort the values of the set in parallel and return a by-value parallel iterator of
497
+ /// the values with the result.
498
+ pub fn par_sorted_unstable_by < F > ( self , cmp : F ) -> IntoParIter < T >
499
+ where
500
+ F : Fn ( & T , & T ) -> Ordering + Sync ,
501
+ {
502
+ let mut entries = self . into_entries ( ) ;
503
+ entries. par_sort_unstable_by ( move |a, b| cmp ( & a. key , & b. key ) ) ;
504
+ IntoParIter { entries }
505
+ }
475
506
}
476
507
477
508
/// Requires crate feature `"rayon"`.
0 commit comments