@@ -572,13 +572,12 @@ impl<F> fmt::Debug for FromFn<F> {
572
572
/// and calls the given `FnMut(&T) -> Option<T>` closure to compute each item’s successor.
573
573
///
574
574
/// ```
575
- /// #![feature(iter_unfold)]
576
575
/// use std::iter::successors;
577
576
///
578
577
/// let powers_of_10 = successors(Some(1_u16), |n| n.checked_mul(10));
579
578
/// assert_eq!(powers_of_10.collect::<Vec<_>>(), &[1, 10, 100, 1_000, 10_000]);
580
579
/// ```
581
- #[ unstable ( feature = "iter_unfold " , issue = "55977 " ) ]
580
+ #[ stable ( feature = "iter_successors " , since = "1.34.0 " ) ]
582
581
pub fn successors < T , F > ( first : Option < T > , succ : F ) -> Successors < T , F >
583
582
where F : FnMut ( & T ) -> Option < T >
584
583
{
@@ -598,13 +597,13 @@ pub fn successors<T, F>(first: Option<T>, succ: F) -> Successors<T, F>
598
597
///
599
598
/// [`successors`]: fn.successors.html
600
599
#[ derive( Clone ) ]
601
- #[ unstable ( feature = "iter_unfold " , issue = "55977 " ) ]
600
+ #[ stable ( feature = "iter_successors " , since = "1.34.0 " ) ]
602
601
pub struct Successors < T , F > {
603
602
next : Option < T > ,
604
603
succ : F ,
605
604
}
606
605
607
- #[ unstable ( feature = "iter_unfold " , issue = "55977 " ) ]
606
+ #[ stable ( feature = "iter_successors " , since = "1.34.0 " ) ]
608
607
impl < T , F > Iterator for Successors < T , F >
609
608
where F : FnMut ( & T ) -> Option < T >
610
609
{
@@ -628,12 +627,12 @@ impl<T, F> Iterator for Successors<T, F>
628
627
}
629
628
}
630
629
631
- #[ unstable ( feature = "iter_unfold " , issue = "55977 " ) ]
630
+ #[ stable ( feature = "iter_successors " , since = "1.34.0 " ) ]
632
631
impl < T , F > FusedIterator for Successors < T , F >
633
632
where F : FnMut ( & T ) -> Option < T >
634
633
{ }
635
634
636
- #[ unstable ( feature = "iter_unfold " , issue = "55977 " ) ]
635
+ #[ stable ( feature = "iter_successors " , since = "1.34.0 " ) ]
637
636
impl < T : fmt:: Debug , F > fmt:: Debug for Successors < T , F > {
638
637
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
639
638
f. debug_struct ( "Successors" )
0 commit comments