From 669d1cd9e28aa6a6aa181c29b9d68edd33491f6f Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 10 Jun 2015 18:01:59 -0700 Subject: [PATCH] std: Deprecate iter::{Unfold, Iterate} Neither of these iterators has seen enough usage to justify their position in the standard library, so these unstable iterators are being slated for deletion. --- src/libcore/iter.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/libcore/iter.rs b/src/libcore/iter.rs index 9d7585993c33..053a85a7c51a 100644 --- a/src/libcore/iter.rs +++ b/src/libcore/iter.rs @@ -2542,6 +2542,9 @@ impl RandomAccessIterator for Inspect /// ``` #[unstable(feature = "iter_unfold")] #[derive(Clone)] +#[deprecated(since = "1.2.0", + reason = "has gained enough traction to retain its position \ + in the standard library")] pub struct Unfold { f: F, /// Internal state that will be passed to the closure on the next iteration @@ -2550,6 +2553,9 @@ pub struct Unfold { } #[unstable(feature = "iter_unfold")] +#[deprecated(since = "1.2.0", + reason = "has gained enough traction to retain its position \ + in the standard library")] impl Unfold where F: FnMut(&mut St) -> Option { /// Creates a new iterator with the specified closure as the "iterator /// function" and an initial state to eventually pass to the closure @@ -2995,11 +3001,17 @@ type IterateState = (F, Option, bool); /// An iterator that repeatedly applies a given function, starting /// from a given seed value. #[unstable(feature = "iter_iterate")] +#[deprecated(since = "1.2.0", + reason = "has gained enough traction to retain its position \ + in the standard library")] pub type Iterate = Unfold, fn(&mut IterateState) -> Option>; /// Creates a new iterator that produces an infinite sequence of /// repeated applications of the given function `f`. #[unstable(feature = "iter_iterate")] +#[deprecated(since = "1.2.0", + reason = "has gained enough traction to retain its position \ + in the standard library")] pub fn iterate(seed: T, f: F) -> Iterate where T: Clone, F: FnMut(T) -> T,