Skip to content

Commit c36f450

Browse files
Update documentation of GroupingMap
1 parent f0fcf7a commit c36f450

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

0 commit comments

Comments
 (0)