pub fn max<T: Ord>(v: &mut [T], n: usize) -> &mut [T] ⓘ
Get the n largest items.
n
This method is stable, i.e. it preserves the order of equal elements.
let mut v = [-5, 4, 1, -3, 2]; let max = out::max(&mut v, 3); assert_eq!(max, [1, 2, 4]);