未验证 提交 df2f9a4b 编写于 作者: K Kagami Sascha Rosylight 提交者: GitHub

Use sort_unstable_by in its own docs

上级 7726070f
......@@ -1654,7 +1654,7 @@ pub fn sort_unstable(&mut self)
///
/// ```
/// 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]);
/// ```
///
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册