@@ -2549,6 +2549,8 @@ pub trait Itertools : Iterator {
2549
2549
/// **Note:** This consumes the entire iterator, uses the
2550
2550
/// [`slice::sort_unstable`] method and returns the result as a new
2551
2551
/// iterator that owns its elements.
2552
+ ///
2553
+ /// This sort is unstable (i.e., may reorder equal elements).
2552
2554
///
2553
2555
/// The sorted iterator, if directly collected to a `Vec`, is converted
2554
2556
/// without any extra copying or allocation cost.
@@ -2578,6 +2580,8 @@ pub trait Itertools : Iterator {
2578
2580
/// **Note:** This consumes the entire iterator, uses the
2579
2581
/// [`slice::sort_unstable_by`] method and returns the result as a new
2580
2582
/// iterator that owns its elements.
2583
+ ///
2584
+ /// This sort is unstable (i.e., may reorder equal elements).
2581
2585
///
2582
2586
/// The sorted iterator, if directly collected to a `Vec`, is converted
2583
2587
/// without any extra copying or allocation cost.
@@ -2611,6 +2615,8 @@ pub trait Itertools : Iterator {
2611
2615
/// **Note:** This consumes the entire iterator, uses the
2612
2616
/// [`slice::sort_unstable_by_key`] method and returns the result as a new
2613
2617
/// iterator that owns its elements.
2618
+ ///
2619
+ /// This sort is unstable (i.e., may reorder equal elements).
2614
2620
///
2615
2621
/// The sorted iterator, if directly collected to a `Vec`, is converted
2616
2622
/// without any extra copying or allocation cost.
@@ -2645,6 +2651,8 @@ pub trait Itertools : Iterator {
2645
2651
/// **Note:** This consumes the entire iterator, uses the
2646
2652
/// [`slice::sort`] method and returns the result as a new
2647
2653
/// iterator that owns its elements.
2654
+ ///
2655
+ /// This sort is stable (i.e., does not reorder equal elements).
2648
2656
///
2649
2657
/// The sorted iterator, if directly collected to a `Vec`, is converted
2650
2658
/// without any extra copying or allocation cost.
@@ -2674,6 +2682,8 @@ pub trait Itertools : Iterator {
2674
2682
/// **Note:** This consumes the entire iterator, uses the
2675
2683
/// [`slice::sort_by`] method and returns the result as a new
2676
2684
/// iterator that owns its elements.
2685
+ ///
2686
+ /// This sort is stable (i.e., does not reorder equal elements).
2677
2687
///
2678
2688
/// The sorted iterator, if directly collected to a `Vec`, is converted
2679
2689
/// without any extra copying or allocation cost.
@@ -2682,7 +2692,7 @@ pub trait Itertools : Iterator {
2682
2692
/// use itertools::Itertools;
2683
2693
///
2684
2694
/// // sort people in descending order by age
2685
- /// let people = vec![("Jane", 20), ("John", 18), ("Jill", 30), ("Jack", 27 )];
2695
+ /// let people = vec![("Jane", 20), ("John", 18), ("Jill", 30), ("Jack", 30 )];
2686
2696
///
2687
2697
/// let oldest_people_first = people
2688
2698
/// .into_iter()
@@ -2707,6 +2717,8 @@ pub trait Itertools : Iterator {
2707
2717
/// **Note:** This consumes the entire iterator, uses the
2708
2718
/// [`slice::sort_by_key`] method and returns the result as a new
2709
2719
/// iterator that owns its elements.
2720
+ ///
2721
+ /// This sort is stable (i.e., does not reorder equal elements).
2710
2722
///
2711
2723
/// The sorted iterator, if directly collected to a `Vec`, is converted
2712
2724
/// without any extra copying or allocation cost.
@@ -2715,7 +2727,7 @@ pub trait Itertools : Iterator {
2715
2727
/// use itertools::Itertools;
2716
2728
///
2717
2729
/// // sort people in descending order by age
2718
- /// let people = vec![("Jane", 20), ("John", 18), ("Jill", 30), ("Jack", 27 )];
2730
+ /// let people = vec![("Jane", 20), ("John", 18), ("Jill", 30), ("Jack", 30 )];
2719
2731
///
2720
2732
/// let oldest_people_first = people
2721
2733
/// .into_iter()
@@ -2742,6 +2754,8 @@ pub trait Itertools : Iterator {
2742
2754
/// **Note:** This consumes the entire iterator, uses the
2743
2755
/// [`slice::sort_by_cached_key`] method and returns the result as a new
2744
2756
/// iterator that owns its elements.
2757
+ ///
2758
+ /// This sort is stable (i.e., does not reorder equal elements).
2745
2759
///
2746
2760
/// The sorted iterator, if directly collected to a `Vec`, is converted
2747
2761
/// without any extra copying or allocation cost.
@@ -2750,7 +2764,7 @@ pub trait Itertools : Iterator {
2750
2764
/// use itertools::Itertools;
2751
2765
///
2752
2766
/// // sort people in descending order by age
2753
- /// let people = vec![("Jane", 20), ("John", 18), ("Jill", 30), ("Jack", 27 )];
2767
+ /// let people = vec![("Jane", 20), ("John", 18), ("Jill", 30), ("Jack", 30 )];
2754
2768
///
2755
2769
/// let oldest_people_first = people
2756
2770
/// .into_iter()
0 commit comments