2 unstable releases
Uses old Rust 2015
0.2.0 | Apr 3, 2015 |
---|---|
0.1.0 | Apr 3, 2015 |
#41 in #aggregate
5,859 downloads per month
Used in 41 crates
(via nickel)
4KB
53 lines
Easily aggregate groups of values from key-value Iterators.
Example
use std::collections::HashMap;
use groupable::Groupable;
let evens = (0..10).map(|i| (i % 2 == 0, i))
.group::<HashMap<bool, Vec<usize>>>();
assert_eq!(evens[&true], [0, 2, 4, 6, 8]);
assert_eq!(evens[&false], [1, 3, 5, 7, 9]);