Closed Philippe-Cholet closed 7 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
6814180
) 94.38% compared to head (79f76be
) 94.15%. Report is 4 commits behind head on master.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
After a second thought, I'm pretty sure type MapForGrouping<I, F> = MapSpecialCase<I, MapForGroupingFn<F>>
would be cleaner.
Seems cleaner indeed.
Related to #755
MapForGrouping
is only internally used byGroupingMapBy
and it only callsfor_each
on it (which in turn rely onfold
). So I allow the clippy lintmissing_trait_methods
because specialize other methods is simply useless. (In case we run clippy with warning it.)I could replace
next
body byunreachable!()
and it would still work fine. Anyway, it will disappear from test coverage now that we have one (see here).I previously wandered how to test and benchmark this:
fold
specialization through someinto_grouping_map_by
benchmark but I simply don't think it's worth the time: no doubtadapted_iterator.map.fold
is faster than the defaultfold
callingnext
repeatedly. We just don't know how much faster.Note that all
GroupingMapBy
methods ultimately rely on thisfold
so this specialization will improve performance for all its methods.