itertools
itertools copied to clipboard
Feature into_group_map_by
Hi, I'm implementing into_group_map_by which is a function that looks like GroupBy in SQL (although I'm not a fan of the name). I was wondering if the feature was welcome or not. I've also created a function into_group_map_by_fold which would be a version with two closures, one for the key and one for aggregation.
If the feature is welcome I'd like to know what kind of documentation and testing is needed, if you could show me an example.
Edit: The version of minimum of rust is legit ? because I can't compile with rust 1.24.
With into_group_map_by, I think you're trying to solve the problem expressed in #304. Is this correct? There's some relevant discussion there. The consensus was that doing a map before into_group_by offered the most flexibility, but I'm not opposed to adding a convenience method that just chains those two methods behind the scenes.
What parameters does your into_group_map_by take?
The version of minimum of rust is legit ? because I can't compile with rust 1.24.
As of #396, our minimum version is 1.32.
With
into_group_map_by, I think you're trying to solve the problem expressed in #304. Is this correct?
Yes it's exactly this problem I'm addressing.
The consensus was that doing a
mapbeforeinto_group_by
It takes only a closure |&T| -> Key but returns an iterator, instead of the HashMap like into_group_map