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:
Ralf Jung 2020-05-24 16:51:36 +02:00 committed by GitHub
commit 134a165b6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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]);
/// ```
///