Crates.io | extrema |
lib.rs | extrema |
version | 0.1.1 |
source | src |
created_at | 2021-09-05 15:04:18.716714 |
updated_at | 2021-09-05 16:36:47.773969 |
description | C++'s minmax_element implementation in rust |
homepage | |
repository | https://github.com/umr1352/extrema |
max_upload_size | |
id | 447162 |
size | 4,044 |
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.
Just call it on a collection!
let xs = vec![0, 1, 2, 3];
let minmax = xs.extrema();
assert_eq!(minmax, Some((0, 3)));