The documentation's description of the return values is slightly incorrect.
|
/// element" in other libraries. It returns a triplet of the following values: all elements less |
|
/// than the one at the given index, the value at the given index, and all elements greater than |
|
/// the one at the given index. |
The following code however, produces ([1, 1], 1, [1, 1]):
let mut v = [1i32; 5];
let (x, y, z) = v.select_nth_unstable(2);
(playground link: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=3c68d77916745c6442866324d675755d)
The documentation's description of the return values is slightly incorrect.
rust/library/core/src/slice/mod.rs
Lines 2631 to 2633 in c845946
The following code however, produces
([1, 1], 1, [1, 1]):(playground link: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=3c68d77916745c6442866324d675755d)