Skip to content

Commit a31e14f

Browse files
Philippe-Choletphimuemue
authored andcommitted
Increase discoverability of merge_join_by (Unix-like comm)
1 parent 91f9618 commit a31e14f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1091,7 +1091,9 @@ pub trait Itertools: Iterator {
10911091
/// let b = (0..10).step_by(3);
10921092
///
10931093
/// itertools::assert_equal(
1094-
/// a.merge_join_by(b, |i, j| i.cmp(j)),
1094+
/// // This performs a diff in the style of the Unix command comm(1),
1095+
/// // generalized to arbitrary types rather than text.
1096+
/// a.merge_join_by(b, Ord::cmp),
10951097
/// vec![Both(0, 0), Left(2), Right(3), Left(4), Both(6, 6), Left(1), Right(9)]
10961098
/// );
10971099
/// ```
@@ -1123,6 +1125,7 @@ pub trait Itertools: Iterator {
11231125
/// );
11241126
/// ```
11251127
#[inline]
1128+
#[doc(alias = "comm")]
11261129
fn merge_join_by<J, F, T>(self, other: J, cmp_fn: F) -> MergeJoinBy<Self, J::IntoIter, F>
11271130
where
11281131
J: IntoIterator,

0 commit comments

Comments
 (0)