Rollup merge of #72535 - saschanaz:patch-1, r=jonas-schievink
Use sort_unstable_by in its own docs Currently it uses `sort_by` instead of itself.
This commit is contained in:
commit
134a165b6c
1 changed files with 1 additions and 1 deletions
|
@ -1654,7 +1654,7 @@ impl<T> [T] {
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// let mut floats = [5f64, 4.0, 1.0, 3.0, 2.0];
|
/// 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]);
|
/// assert_eq!(floats, [1.0, 2.0, 3.0, 4.0, 5.0]);
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue