Skip to content

Commit 8bd1515

Browse files
committed
change return type
1 parent 285af83 commit 8bd1515

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/lib.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ use std::hash::Hash;
6565
use std::fmt::Write;
6666
#[cfg(feature = "use_std")]
6767
type VecIntoIter<T> = ::std::vec::IntoIter<T>;
68-
#[cfg(feature = "use_std")]
69-
type HashMapIntoIter<K, V> = ::std::collections::hash_map::IntoIter<K, V>;
7068
use std::iter::FromIterator;
7169

7270
#[macro_use]
@@ -2191,8 +2189,7 @@ pub trait Itertools : Iterator {
21912189
///
21922190
/// let data = vec![(0, 10), (2, 12), (3, 13), (0, 20), (3, 33), (2, 42)];
21932191
/// let lookup: HashMap<u32,Vec<(u32, u32)>> = data.clone().into_iter().into_group_map_by(|a|
2194-
/// a.0)
2195-
/// .collect();
2192+
/// a.0);
21962193
///
21972194
/// assert_eq!(lookup[&0], vec![(0,10),(0,20)]);
21982195
/// assert_eq!(lookup.get(&1), None);
@@ -2202,11 +2199,12 @@ pub trait Itertools : Iterator {
22022199
/// assert_eq!(
22032200
/// data.into_iter()
22042201
/// .into_group_map_by(|x| x.0)
2202+
/// .into_iter()
22052203
/// .map(|(key, values)| (key, values.into_iter().fold(0,|acc, (_,v)| acc + v )))
22062204
/// .collect::<HashMap<u32,u32>>()[&0], 30)
22072205
/// ```
22082206
#[cfg(feature = "use_std")]
2209-
fn into_group_map_by<K, V, F>(self, f: F) -> HashMapIntoIter<K, Vec<V>>
2207+
fn into_group_map_by<K, V, F>(self, f: F) -> HashMap<K, Vec<V>>
22102208
where
22112209
Self: Iterator<Item=V> + Sized,
22122210
K: Hash + Eq,

0 commit comments

Comments
 (0)