From 2b5e83f150fb4015f7bcee2f788fdde26ffbf178 Mon Sep 17 00:00:00 2001 From: Willem Wyndham Date: Fri, 12 Aug 2022 15:31:35 -0400 Subject: [PATCH 1/2] Chore: update tree_fold1 doc to remove reference to deprecated fold1 Not sure if this is needed, but I thought since it's deprecated it's best to move away from it. --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 5cca5d99f..4984013e6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2271,7 +2271,7 @@ pub trait Itertools : Iterator { /// ``` /// /// Which, for non-associative functions, will typically produce a different - /// result than the linear call tree used by `fold1`: + /// result than the linear call tree used by [`Iterator::reduce`](https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.reduce): /// /// ```text /// 1 2 3 4 5 6 7 @@ -2279,7 +2279,7 @@ pub trait Itertools : Iterator { /// └─f─f─f─f─f─f /// ``` /// - /// If `f` is associative, prefer the normal `fold1` instead. + /// If `f` is associative, prefer the normal [`Iterator::reduce`](https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.reduce) instead. /// /// ``` /// use itertools::Itertools; From 677900a0dd817638db718faa8e26b8df3b99cf07 Mon Sep 17 00:00:00 2001 From: Willem Wyndham Date: Mon, 15 Aug 2022 15:09:32 -0400 Subject: [PATCH 2/2] Apply suggestions from code review --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 4984013e6..f91968870 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2271,7 +2271,7 @@ pub trait Itertools : Iterator { /// ``` /// /// Which, for non-associative functions, will typically produce a different - /// result than the linear call tree used by [`Iterator::reduce`](https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.reduce): + /// result than the linear call tree used by [`Iterator::reduce`]: /// /// ```text /// 1 2 3 4 5 6 7 @@ -2279,7 +2279,7 @@ pub trait Itertools : Iterator { /// └─f─f─f─f─f─f /// ``` /// - /// If `f` is associative, prefer the normal [`Iterator::reduce`](https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.reduce) instead. + /// If `f` is associative, prefer the normal [`Iterator::reduce`] instead. /// /// ``` /// use itertools::Itertools;