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:12 -07:00 committed by GitHub
parent de7f1b670b
commit c0aa7b5cf0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3162,8 +3162,8 @@ impl<T> [T] {
/// ```
/// let mut v = [-5i32, 4, 2, -3, 1];
///
/// // Find the items `>=` the median, the median, and `<=` the median, by using a reversed
/// // comparator.
/// // Find the items `>=` to the median, the median itself, and the items `<=` to it, by using
/// // a reversed comparator.
/// let (before, median, after) = v.select_nth_unstable_by(2, |a, b| b.cmp(a));
///
/// assert!(before == [4, 2] || before == [2, 4]);