@@ -514,7 +514,6 @@ pub fn once_with<A, F: FnOnce() -> A>(gen: F) -> OnceWith<F> {
514
514
/// [module-level documentation]: index.html
515
515
///
516
516
/// ```
517
- /// #![feature(iter_unfold)]
518
517
/// let mut count = 0;
519
518
/// let counter = std::iter::from_fn(move || {
520
519
/// // Increment our count. This is why we started at zero.
@@ -530,7 +529,7 @@ pub fn once_with<A, F: FnOnce() -> A>(gen: F) -> OnceWith<F> {
530
529
/// assert_eq!(counter.collect::<Vec<_>>(), &[1, 2, 3, 4, 5]);
531
530
/// ```
532
531
#[ inline]
533
- #[ unstable ( feature = "iter_unfold " , issue = "55977 " ) ]
532
+ #[ stable ( feature = "iter_from_fn " , since = "1.34.0 " ) ]
534
533
pub fn from_fn < T , F > ( f : F ) -> FromFn < F >
535
534
where F : FnMut ( ) -> Option < T >
536
535
{
@@ -544,10 +543,10 @@ pub fn from_fn<T, F>(f: F) -> FromFn<F>
544
543
///
545
544
/// [`iter::from_fn`]: fn.from_fn.html
546
545
#[ derive( Clone ) ]
547
- #[ unstable ( feature = "iter_unfold " , issue = "55977 " ) ]
546
+ #[ stable ( feature = "iter_from_fn " , since = "1.34.0 " ) ]
548
547
pub struct FromFn < F > ( F ) ;
549
548
550
- #[ unstable ( feature = "iter_unfold " , issue = "55977 " ) ]
549
+ #[ stable ( feature = "iter_from_fn " , since = "1.34.0 " ) ]
551
550
impl < T , F > Iterator for FromFn < F >
552
551
where F : FnMut ( ) -> Option < T >
553
552
{
@@ -559,7 +558,7 @@ impl<T, F> Iterator for FromFn<F>
559
558
}
560
559
}
561
560
562
- #[ unstable ( feature = "iter_unfold " , issue = "55977 " ) ]
561
+ #[ stable ( feature = "iter_from_fn " , since = "1.34.0 " ) ]
563
562
impl < F > fmt:: Debug for FromFn < F > {
564
563
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
565
564
f. debug_struct ( "FromFn" ) . finish ( )
@@ -572,13 +571,12 @@ impl<F> fmt::Debug for FromFn<F> {
572
571
/// and calls the given `FnMut(&T) -> Option<T>` closure to compute each item’s successor.
573
572
///
574
573
/// ```
575
- /// #![feature(iter_unfold)]
576
574
/// use std::iter::successors;
577
575
///
578
576
/// let powers_of_10 = successors(Some(1_u16), |n| n.checked_mul(10));
579
577
/// assert_eq!(powers_of_10.collect::<Vec<_>>(), &[1, 10, 100, 1_000, 10_000]);
580
578
/// ```
581
- #[ unstable ( feature = "iter_unfold " , issue = "55977 " ) ]
579
+ #[ stable ( feature = "iter_successors " , since = "1.34.0 " ) ]
582
580
pub fn successors < T , F > ( first : Option < T > , succ : F ) -> Successors < T , F >
583
581
where F : FnMut ( & T ) -> Option < T >
584
582
{
@@ -598,13 +596,13 @@ pub fn successors<T, F>(first: Option<T>, succ: F) -> Successors<T, F>
598
596
///
599
597
/// [`successors`]: fn.successors.html
600
598
#[ derive( Clone ) ]
601
- #[ unstable ( feature = "iter_unfold " , issue = "55977 " ) ]
599
+ #[ stable ( feature = "iter_successors " , since = "1.34.0 " ) ]
602
600
pub struct Successors < T , F > {
603
601
next : Option < T > ,
604
602
succ : F ,
605
603
}
606
604
607
- #[ unstable ( feature = "iter_unfold " , issue = "55977 " ) ]
605
+ #[ stable ( feature = "iter_successors " , since = "1.34.0 " ) ]
608
606
impl < T , F > Iterator for Successors < T , F >
609
607
where F : FnMut ( & T ) -> Option < T >
610
608
{
@@ -628,12 +626,12 @@ impl<T, F> Iterator for Successors<T, F>
628
626
}
629
627
}
630
628
631
- #[ unstable ( feature = "iter_unfold " , issue = "55977 " ) ]
629
+ #[ stable ( feature = "iter_successors " , since = "1.34.0 " ) ]
632
630
impl < T , F > FusedIterator for Successors < T , F >
633
631
where F : FnMut ( & T ) -> Option < T >
634
632
{ }
635
633
636
- #[ unstable ( feature = "iter_unfold " , issue = "55977 " ) ]
634
+ #[ stable ( feature = "iter_successors " , since = "1.34.0 " ) ]
637
635
impl < T : fmt:: Debug , F > fmt:: Debug for Successors < T , F > {
638
636
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
639
637
f. debug_struct ( "Successors" )
0 commit comments