From d1ce07db021a95a217e8b84146d9d623d50d56ff Mon Sep 17 00:00:00 2001 From: Philippe-Cholet <44676486+Philippe-Cholet@users.noreply.github.com> Date: Mon, 13 May 2024 16:49:16 +0200 Subject: [PATCH] Deprecated for the std: link to the documentation. Strictly similar to what is done for our free function `zip`. --- src/lib.rs | 5 ++++- src/sources.rs | 10 ++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 5a1248d5a..931a28f92 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2426,7 +2426,10 @@ pub trait Itertools: Iterator { /// assert_eq!((0..10).fold1(|x, y| x + y).unwrap_or(0), 45); /// assert_eq!((0..0).fold1(|x, y| x * y), None); /// ``` - #[deprecated(since = "0.10.2", note = "Use `Iterator::reduce` instead")] + #[deprecated( + note = "Use [`Iterator::reduce`](https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.reduce) instead", + since = "0.10.2" + )] fn fold1(mut self, f: F) -> Option where F: FnMut(Self::Item, Self::Item) -> Self::Item, diff --git a/src/sources.rs b/src/sources.rs index 425324fac..c405ffdc7 100644 --- a/src/sources.rs +++ b/src/sources.rs @@ -41,7 +41,10 @@ use std::mem; /// vec![1, 1, 2, 3, 5, 8, 13, 21]); /// assert_eq!(fibonacci.last(), Some(2_971_215_073)) /// ``` -#[deprecated(note = "Use std from_fn() instead", since = "0.13.0")] +#[deprecated( + note = "Use [std::iter::from_fn](https://doc.rust-lang.org/std/iter/fn.from_fn.html) instead", + since = "0.13.0" +)] pub fn unfold(initial_state: St, f: F) -> Unfold where F: FnMut(&mut St) -> Option, @@ -62,7 +65,10 @@ where /// See [`unfold`](crate::unfold) for more information. #[derive(Clone)] #[must_use = "iterators are lazy and do nothing unless consumed"] -#[deprecated(note = "Use std from_fn() instead", since = "0.13.0")] +#[deprecated( + note = "Use [std::iter::FromFn](https://doc.rust-lang.org/std/iter/struct.FromFn.html) instead", + since = "0.13.0" +)] pub struct Unfold { f: F, /// Internal state that will be passed to the closure on the next iteration