Update library/core/src/slice/mod.rs
Co-authored-by: Ibraheem Ahmed <ibraheem@ibraheem.ca>
This commit is contained in:
@@ -3227,8 +3227,7 @@ impl<T> [T] {
|
|||||||
/// ```
|
/// ```
|
||||||
/// let mut v = [-5i32, 4, 1, -3, 2];
|
/// let mut v = [-5i32, 4, 1, -3, 2];
|
||||||
///
|
///
|
||||||
/// // Find the items <= the median absolute value, the median absolute value, and >= the median
|
/// // Find the items `<=` to the absolute median, the absolute median itself, and the items `>=` to it.
|
||||||
/// // absolute value.
|
|
||||||
/// let (lesser, median, greater) = v.select_nth_unstable_by_key(2, |a| a.abs());
|
/// let (lesser, median, greater) = v.select_nth_unstable_by_key(2, |a| a.abs());
|
||||||
///
|
///
|
||||||
/// assert!(lesser == [1, 2] || lesser == [2, 1]);
|
/// assert!(lesser == [1, 2] || lesser == [2, 1]);
|
||||||
|
|||||||
Reference in New Issue
Block a user