mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 16:54:01 +00:00
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
@ -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]);
|
||||
/// ```
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user