[][src]Function out::iter::max_unstable

pub fn max_unstable<T: Ord>(
    iter: impl IntoIterator<Item = T>,
    n: usize
) -> Vec<T>

Returns the n largest items from an iterator.

This sort is unstable (i.e. may reorder equal elements) and typically faster than max.

Panics

Panics if n > len.

Examples

let max = out::iter::max_unstable(-10..10, 3);
assert_eq!(max, [7, 8, 9]);