[][src]Function out::iter::max

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

Returns the n largest items from an iterator.

This function is stable, i.e. it preserves the order of equal elements.

Panics

Panics if n > len.

Examples

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