Added into_grouping_map function on the Itertools trait
@@ -110,6 +110,8 @@ pub mod structs {
pub use crate::exactly_one_err::ExactlyOneError;
pub use crate::format::{Format, FormatWith};
#[cfg(feature = "use_std")]
+ pub use crate::grouping_map::GroupingMap;
+ #[cfg(feature = "use_std")]
pub use crate::groupbylazy::{IntoChunks, Chunk, Chunks, GroupBy, Group, Groups};
pub use crate::intersperse::{Intersperse, IntersperseWith};
#[cfg(feature = "use_std")]
@@ -180,6 +182,8 @@ mod exactly_one_err;
mod diff;
mod format;
#[cfg(feature = "use_std")]
+mod grouping_map;
+#[cfg(feature = "use_std")]
mod group_map;
#[cfg(feature = "use_std")]
mod groupbylazy;
@@ -2328,6 +2332,14 @@ pub trait Itertools : Iterator {
group_map::into_group_map(self)
}
+ #[cfg(feature = "use_std")]
+ fn into_grouping_map<K, V>(self) -> GroupingMap<Self>
+ where Self: Iterator<Item=(K, V)> + Sized,
+ K: Hash + Eq,
+ {
+ grouping_map::new(self)
+ }
+
/// Return the minimum and maximum elements in the iterator.
///
/// The return type `MinMaxResult` is an enum of three variants:
