Skip to content

Commit

Permalink
impl Debug, Clone for GroupingMapFn
Browse files Browse the repository at this point in the history
  • Loading branch information
phimuemue committed Feb 13, 2024
1 parent 21be768 commit 5c6edf3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/grouping_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,13 @@ use std::ops::{Add, Mul};
/// A wrapper to allow for an easy [`into_grouping_map_by`](crate::Itertools::into_grouping_map_by)
pub type MapForGrouping<I, F> = MapSpecialCase<I, GroupingMapFn<F>>;

#[derive(Clone)]
pub struct GroupingMapFn<F>(F);

impl<F> std::fmt::Debug for GroupingMapFn<F> {
debug_fmt_fields!(GroupingMapFn,);
}

impl<V, K, F: FnMut(&V) -> K> MapSpecialCaseFn<V> for GroupingMapFn<F> {
type Out = (K, V);
fn call(&mut self, v: V) -> Self::Out {
Expand Down

0 comments on commit 5c6edf3

Please sign in to comment.