Skip to content

Commit 5a71e63

Browse files
Update documentation of GroupingMap
1 parent bf8e4aa commit 5a71e63

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/grouping_map.rs

+6
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ pub type GroupingMapBy<I, F> = GroupingMap<MapForGrouping<I, F>>;
5858
/// It groups elements by their key and at the same time fold each group
5959
/// using some aggregating operation.
6060
///
61+
/// Each method have a `_in`-suffixed version where you can provide a map other than
62+
/// `HashMap::new()` such as:
63+
/// - `BTreeMap::new()` when the values are `Ord` and not necessarily `Hash + Eq`.
64+
/// - `HashMap::default()` to use a different hasher.
65+
/// - `HashMap::with_capacity(100)` to pre-allocate.
66+
///
6167
/// No method on this struct performs temporary allocations.
6268
#[derive(Clone, Debug)]
6369
#[must_use = "GroupingMap is lazy and do nothing unless consumed"]

0 commit comments

Comments
 (0)