Skip to content

Commit 94452e3

Browse files
Philippe-Choletjswrenn
authored andcommittedJan 23, 2024
GroupingMapBy: fix Debug implementation
Derive it is not the best in this case since `F` is a function. `MapForGrouping` is now Debug and `GroupingMapBy` too as it wraps it.
1 parent 2e325a0 commit 94452e3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed
 

‎src/grouping_map.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,19 @@
33
use crate::MinMaxResult;
44
use std::cmp::Ordering;
55
use std::collections::HashMap;
6+
use std::fmt;
67
use std::hash::Hash;
78
use std::iter::Iterator;
89
use std::ops::{Add, Mul};
910

1011
/// A wrapper to allow for an easy [`into_grouping_map_by`](crate::Itertools::into_grouping_map_by)
11-
#[derive(Clone, Debug)]
12+
#[derive(Clone)]
1213
pub struct MapForGrouping<I, F>(I, F);
1314

15+
impl<I: fmt::Debug, F> fmt::Debug for MapForGrouping<I, F> {
16+
debug_fmt_fields!(MapForGrouping, 0);
17+
}
18+
1419
impl<I, F> MapForGrouping<I, F> {
1520
pub(crate) fn new(iter: I, key_mapper: F) -> Self {
1621
Self(iter, key_mapper)

0 commit comments

Comments
 (0)