Skip to content

Commit 6577843

Browse files
committed
Document minmax behaviour when several elements are equally minimum or maximum
1 parent 3b6c52d commit 6577843

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/grouping_map.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,9 @@ impl<I, K, V> GroupingMap<I>
399399
/// Groups elements from the `GroupingMap` source by key and find the maximum and minimum of
400400
/// each group.
401401
///
402+
/// If several elements are equally maximum, the last element is picked.
403+
/// If several elements are equally minimum, the first element is picked.
404+
///
402405
/// See [.minmax_by()](../trait.Itertools.html#method.minmax) for the non-grouping version.
403406
///
404407
/// Differences from the non grouping version:
@@ -429,6 +432,9 @@ impl<I, K, V> GroupingMap<I>
429432
/// Groups elements from the `GroupingMap` source by key and find the maximum and minimum of
430433
/// each group with respect to the specified comparison function.
431434
///
435+
/// If several elements are equally maximum, the last element is picked.
436+
/// If several elements are equally minimum, the first element is picked.
437+
///
432438
/// It has the same differences from the non-grouping version as `minmax`.
433439
///
434440
/// Returns a `HashMap` associating the key of each group with the minimum and maximum of that group's elements.
@@ -476,6 +482,9 @@ impl<I, K, V> GroupingMap<I>
476482
/// Groups elements from the `GroupingMap` source by key and find the elements of each group
477483
/// that gives the minimum and maximum from the specified function.
478484
///
485+
/// If several elements are equally maximum, the last element is picked.
486+
/// If several elements are equally minimum, the first element is picked.
487+
///
479488
/// It has the same differences from the non-grouping version as `minmax`.
480489
///
481490
/// Returns a `HashMap` associating the key of each group with the minimum and maximum of that group's elements.

0 commit comments

Comments
 (0)