1
Fork 0

Update library/core/src/slice/mod.rs

Co-authored-by: Ibraheem Ahmed <ibraheem@ibraheem.ca>
This commit is contained in:
Michael Sloan 2025-01-18 18:35:41 -07:00 committed by GitHub
parent 6ac44fa5fa
commit fd89cf9b8f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3227,8 +3227,7 @@ impl<T> [T] {
/// ```
/// let mut v = [-5i32, 4, 1, -3, 2];
///
/// // Find the items <= the median absolute value, the median absolute value, and >= the median
/// // absolute value.
/// // Find the items `<=` to the absolute median, the absolute median itself, and the items `>=` to it.
/// let (lesser, median, greater) = v.select_nth_unstable_by_key(2, |a| a.abs());
///
/// assert!(lesser == [1, 2] || lesser == [2, 1]);