From df2f9a4bd11b2067379c0c97eca3a249fe67fc17 Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Sun, 24 May 2020 14:56:57 +0200 Subject: [PATCH] Use sort_unstable_by in its own docs --- src/libcore/slice/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcore/slice/mod.rs b/src/libcore/slice/mod.rs index b5ce165cb43db..2361749f16645 100644 --- a/src/libcore/slice/mod.rs +++ b/src/libcore/slice/mod.rs @@ -1654,7 +1654,7 @@ impl [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]); /// ``` ///