From a31e14fc73398bb83482f1ec8fdf59dc584f7561 Mon Sep 17 00:00:00 2001 From: Philippe-Cholet <44676486+Philippe-Cholet@users.noreply.github.com> Date: Wed, 3 Jul 2024 22:04:19 +0200 Subject: [PATCH] Increase discoverability of `merge_join_by` (Unix-like `comm`) --- src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 604529a59..9670390a9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1091,7 +1091,9 @@ pub trait Itertools: Iterator { /// let b = (0..10).step_by(3); /// /// itertools::assert_equal( - /// a.merge_join_by(b, |i, j| i.cmp(j)), + /// // This performs a diff in the style of the Unix command comm(1), + /// // generalized to arbitrary types rather than text. + /// a.merge_join_by(b, Ord::cmp), /// vec![Both(0, 0), Left(2), Right(3), Left(4), Both(6, 6), Left(1), Right(9)] /// ); /// ``` @@ -1123,6 +1125,7 @@ pub trait Itertools: Iterator { /// ); /// ``` #[inline] + #[doc(alias = "comm")] fn merge_join_by(self, other: J, cmp_fn: F) -> MergeJoinBy where J: IntoIterator,