extrema

Crates.ioextrema
lib.rsextrema
version0.1.1
sourcesrc
created_at2021-09-05 15:04:18.716714
updated_at2021-09-05 16:36:47.773969
descriptionC++'s minmax_element implementation in rust
homepage
repositoryhttps://github.com/umr1352/extrema
max_upload_size
id447162
size4,044
Enrico Marconi (UMR1352)

documentation

https://docs.rs/extrema

README

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)));
Commit count: 4

cargo fmt