#group #iterator #values #key-value #aggregate

groupable

Easily aggregate groups of values from key-value Iterators

2 unstable releases

Uses old Rust 2015

0.2.0 Apr 3, 2015
0.1.0 Apr 3, 2015

#41 in #aggregate

Download history 1026/week @ 2024-09-01 1323/week @ 2024-09-08 1098/week @ 2024-09-15 1566/week @ 2024-09-22 1764/week @ 2024-09-29 1339/week @ 2024-10-06 1894/week @ 2024-10-13 2491/week @ 2024-10-20 1311/week @ 2024-10-27 1595/week @ 2024-11-03 1222/week @ 2024-11-10 1484/week @ 2024-11-17 1780/week @ 2024-11-24 1366/week @ 2024-12-01 1443/week @ 2024-12-08 1169/week @ 2024-12-15

5,859 downloads per month
Used in 41 crates (via nickel)

MIT license

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

No runtime deps