Skip to content

Latest commit

 

History

History
13 lines (11 loc) · 488 Bytes

README.md

File metadata and controls

13 lines (11 loc) · 488 Bytes

Utility for finding the minimum and maximum elements of an iterable collection in a single pass without copy. Similar to C++'s minmax_element, Julia's extrema and Ruby's minmax.

Usage

Just call it on a collection!

let xs = vec![0, 1, 2, 3];
let minmax = xs.extrema();

assert_eq!(minmax, Some((0, 3)));