extrema 0.1.1

C++'s minmax_element implementation in rust
Documentation
  • Coverage
  • 100%
    4 out of 4 items documented2 out of 3 items with examples
  • Size
  • Source code size: 3.67 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.07 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • UMR1352/extrema
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • UMR1352

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)));