From 5be471956c34d4ca1da02ca1e1d81c9cc64a4b8e Mon Sep 17 00:00:00 2001 From: Philippe-Cholet <44676486+Philippe-Cholet@users.noreply.github.com> Date: Wed, 7 Feb 2024 08:48:15 +0100 Subject: [PATCH 1/2] Deprecate `unfold` for `std::iter::from_fn` --- src/sources.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/sources.rs b/src/sources.rs index a7f51e52f..0cfd79d5f 100644 --- a/src/sources.rs +++ b/src/sources.rs @@ -98,6 +98,7 @@ where /// 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")] pub fn unfold(initial_state: St, f: F) -> Unfold where F: FnMut(&mut St) -> Option, @@ -118,6 +119,7 @@ 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")] pub struct Unfold { f: F, /// Internal state that will be passed to the closure on the next iteration From 777b341e15b66cd8dd679f27799961047202ebe6 Mon Sep 17 00:00:00 2001 From: Philippe-Cholet <44676486+Philippe-Cholet@users.noreply.github.com> Date: Wed, 7 Feb 2024 08:54:25 +0100 Subject: [PATCH 2/2] Bump version --- Cargo.toml | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 70af68465..e3bfdabd7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "itertools" -version = "0.12.1" +version = "0.13.0" license = "MIT OR Apache-2.0" repository = "https://github.com/rust-itertools/itertools" diff --git a/README.md b/README.md index 9acac2d37..24059e514 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ How to use with Cargo: ```toml [dependencies] -itertools = "0.12.1" +itertools = "0.13.0" ``` How to use in your crate: