@@ -2542,6 +2542,9 @@ impl<I: RandomAccessIterator, F> RandomAccessIterator for Inspect<I, F>
2542
2542
/// ```
2543
2543
#[ unstable( feature = "iter_unfold" ) ]
2544
2544
#[ derive( Clone ) ]
2545
+ #[ deprecated( since = "1.2.0" ,
2546
+ reason = "has gained enough traction to retain its position \
2547
+ in the standard library") ]
2545
2548
pub struct Unfold < St , F > {
2546
2549
f : F ,
2547
2550
/// Internal state that will be passed to the closure on the next iteration
@@ -2550,6 +2553,9 @@ pub struct Unfold<St, F> {
2550
2553
}
2551
2554
2552
2555
#[ unstable( feature = "iter_unfold" ) ]
2556
+ #[ deprecated( since = "1.2.0" ,
2557
+ reason = "has gained enough traction to retain its position \
2558
+ in the standard library") ]
2553
2559
impl < A , St , F > Unfold < St , F > where F : FnMut ( & mut St ) -> Option < A > {
2554
2560
/// Creates a new iterator with the specified closure as the "iterator
2555
2561
/// function" and an initial state to eventually pass to the closure
@@ -2995,11 +3001,17 @@ type IterateState<T, F> = (F, Option<T>, bool);
2995
3001
/// An iterator that repeatedly applies a given function, starting
2996
3002
/// from a given seed value.
2997
3003
#[ unstable( feature = "iter_iterate" ) ]
3004
+ #[ deprecated( since = "1.2.0" ,
3005
+ reason = "has gained enough traction to retain its position \
3006
+ in the standard library") ]
2998
3007
pub type Iterate < T , F > = Unfold < IterateState < T , F > , fn ( & mut IterateState < T , F > ) -> Option < T > > ;
2999
3008
3000
3009
/// Creates a new iterator that produces an infinite sequence of
3001
3010
/// repeated applications of the given function `f`.
3002
3011
#[ unstable( feature = "iter_iterate" ) ]
3012
+ #[ deprecated( since = "1.2.0" ,
3013
+ reason = "has gained enough traction to retain its position \
3014
+ in the standard library") ]
3003
3015
pub fn iterate < T , F > ( seed : T , f : F ) -> Iterate < T , F > where
3004
3016
T : Clone ,
3005
3017
F : FnMut ( T ) -> T ,
0 commit comments