Skip to content

Commit

Permalink
Rollup merge of #72535 - saschanaz:patch-1, r=jonas-schievink
Browse files Browse the repository at this point in the history
Use sort_unstable_by in its own docs

Currently it uses `sort_by` instead of itself.
  • Loading branch information
RalfJung authored May 24, 2020
2 parents 67b4e2b + df2f9a4 commit 134a165
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libcore/slice/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1654,7 +1654,7 @@ impl<T> [T] {
///
/// ```
/// let mut floats = [5f64, 4.0, 1.0, 3.0, 2.0];
/// floats.sort_by(|a, b| a.partial_cmp(b).unwrap());
/// floats.sort_unstable_by(|a, b| a.partial_cmp(b).unwrap());
/// assert_eq!(floats, [1.0, 2.0, 3.0, 4.0, 5.0]);
/// ```
///
Expand Down

0 comments on commit 134a165

Please sign in to comment.