@@ -2724,18 +2724,18 @@ pub trait Itertools : Iterator {
2724
2724
group_map:: into_group_map ( self )
2725
2725
}
2726
2726
2727
- /// Return an `Iterator` on a HahMap . Keys mapped to `Vec`s of values. The key is specified in
2727
+ /// Return an `Iterator` on a `HashMap` . Keys mapped to `Vec`s of values. The key is specified
2728
2728
/// in the closure.
2729
- /// Different of into_group_map_by because the key is still present. It is also more general.
2730
- /// you can also fold the group_map.
2729
+ /// Different to ` into_group_map_by` because the key is still present. It is also more general.
2730
+ /// You can also fold the ` group_map` .
2731
2731
///
2732
2732
/// ```
2733
2733
/// use itertools::Itertools;
2734
2734
/// use std::collections::HashMap;
2735
2735
///
2736
2736
/// let data = vec![(0, 10), (2, 12), (3, 13), (0, 20), (3, 33), (2, 42)];
2737
- /// let lookup: HashMap<u32,Vec<(u32, u32)>> = data.clone().into_iter().into_group_map_by(|a|
2738
- /// a.0);
2737
+ /// let lookup: HashMap<u32,Vec<(u32, u32)>> =
2738
+ /// data.clone().into_iter().into_group_map_by(|a| a.0);
2739
2739
///
2740
2740
/// assert_eq!(lookup[&0], vec![(0,10),(0,20)]);
2741
2741
/// assert_eq!(lookup.get(&1), None);
@@ -2744,10 +2744,12 @@ pub trait Itertools : Iterator {
2744
2744
///
2745
2745
/// assert_eq!(
2746
2746
/// data.into_iter()
2747
- /// .into_group_map_by(|x| x.0)
2748
- /// .into_iter()
2749
- /// .map(|(key, values)| (key, values.into_iter().fold(0,|acc, (_,v)| acc + v )))
2750
- /// .collect::<HashMap<u32,u32>>()[&0], 30)
2747
+ /// .into_group_map_by(|x| x.0)
2748
+ /// .into_iter()
2749
+ /// .map(|(key, values)| (key, values.into_iter().fold(0,|acc, (_,v)| acc + v )))
2750
+ /// .collect::<HashMap<u32,u32>>()[&0],
2751
+ /// 30,
2752
+ /// );
2751
2753
/// ```
2752
2754
#[ cfg( feature = "use_std" ) ]
2753
2755
fn into_group_map_by < K , V , F > ( self , f : F ) -> HashMap < K , Vec < V > >
0 commit comments