[][src]Function out::iter::min_unstable

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

Returns the n smallest items from an iterator.

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

Panics

Panics if n > len.

Examples

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