about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-06-10 18:01:59 -0700
committerAlex Crichton <alex@alexcrichton.com>2015-06-17 09:07:16 -0700
commit669d1cd9e28aa6a6aa181c29b9d68edd33491f6f (patch)
tree1889abc85d10265913b227bf035c3ff7b0d4e3ec /src/libcore
parent02a8d5b57057a5c76667e85e92ea2c8a95303150 (diff)
downloadrust-669d1cd9e28aa6a6aa181c29b9d68edd33491f6f.tar.gz
rust-669d1cd9e28aa6a6aa181c29b9d68edd33491f6f.zip
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.
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/iter.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libcore/iter.rs b/src/libcore/iter.rs
index 9d7585993c3..053a85a7c51 100644
--- a/src/libcore/iter.rs
+++ b/src/libcore/iter.rs
@@ -2542,6 +2542,9 @@ impl<I: RandomAccessIterator, F> RandomAccessIterator for Inspect<I, F>
 /// ```
 #[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<St, F> {
     f: F,
     /// Internal state that will be passed to the closure on the next iteration
@@ -2550,6 +2553,9 @@ pub struct Unfold<St, F> {
 }
 
 #[unstable(feature = "iter_unfold")]
+#[deprecated(since = "1.2.0",
+             reason = "has gained enough traction to retain its position \
+                       in the standard library")]
 impl<A, St, F> Unfold<St, F> where F: FnMut(&mut St) -> Option<A> {
     /// 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<T, F> = (F, Option<T>, 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<T, F> = Unfold<IterateState<T, F>, fn(&mut IterateState<T, F>) -> Option<T>>;
 
 /// 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<T, F>(seed: T, f: F) -> Iterate<T, F> where
     T: Clone,
     F: FnMut(T) -> T,