@@ -399,12 +399,12 @@ pub fn once<T>(value: T) -> Once<T> {
399399///
400400/// [`once_with`]: fn.once_with.html
401401#[ derive( Copy , Clone , Debug ) ]
402- #[ unstable ( feature = "iter_once_with" , issue = "57581 " ) ]
402+ #[ stable ( feature = "iter_once_with" , since = "1.43.0 " ) ]
403403pub struct OnceWith < F > {
404404 gen : Option < F > ,
405405}
406406
407- #[ unstable ( feature = "iter_once_with" , issue = "57581 " ) ]
407+ #[ stable ( feature = "iter_once_with" , since = "1.43.0 " ) ]
408408impl < A , F : FnOnce ( ) -> A > Iterator for OnceWith < F > {
409409 type Item = A ;
410410
@@ -420,24 +420,24 @@ impl<A, F: FnOnce() -> A> Iterator for OnceWith<F> {
420420 }
421421}
422422
423- #[ unstable ( feature = "iter_once_with" , issue = "57581 " ) ]
423+ #[ stable ( feature = "iter_once_with" , since = "1.43.0 " ) ]
424424impl < A , F : FnOnce ( ) -> A > DoubleEndedIterator for OnceWith < F > {
425425 fn next_back ( & mut self ) -> Option < A > {
426426 self . next ( )
427427 }
428428}
429429
430- #[ unstable ( feature = "iter_once_with" , issue = "57581 " ) ]
430+ #[ stable ( feature = "iter_once_with" , since = "1.43.0 " ) ]
431431impl < A , F : FnOnce ( ) -> A > ExactSizeIterator for OnceWith < F > {
432432 fn len ( & self ) -> usize {
433433 self . gen . iter ( ) . len ( )
434434 }
435435}
436436
437- #[ unstable ( feature = "iter_once_with" , issue = "57581 " ) ]
437+ #[ stable ( feature = "iter_once_with" , since = "1.43.0 " ) ]
438438impl < A , F : FnOnce ( ) -> A > FusedIterator for OnceWith < F > { }
439439
440- #[ unstable ( feature = "iter_once_with" , issue = "57581 " ) ]
440+ #[ stable ( feature = "iter_once_with" , since = "1.43.0 " ) ]
441441unsafe impl < A , F : FnOnce ( ) -> A > TrustedLen for OnceWith < F > { }
442442
443443/// Creates an iterator that lazily generates a value exactly once by invoking
@@ -458,8 +458,6 @@ unsafe impl<A, F: FnOnce() -> A> TrustedLen for OnceWith<F> {}
458458/// Basic usage:
459459///
460460/// ```
461- /// #![feature(iter_once_with)]
462- ///
463461/// use std::iter;
464462///
465463/// // one is the loneliest number
@@ -476,8 +474,6 @@ unsafe impl<A, F: FnOnce() -> A> TrustedLen for OnceWith<F> {}
476474/// `.foorc`:
477475///
478476/// ```no_run
479- /// #![feature(iter_once_with)]
480- ///
481477/// use std::iter;
482478/// use std::fs;
483479/// use std::path::PathBuf;
@@ -500,7 +496,7 @@ unsafe impl<A, F: FnOnce() -> A> TrustedLen for OnceWith<F> {}
500496/// }
501497/// ```
502498#[ inline]
503- #[ unstable ( feature = "iter_once_with" , issue = "57581 " ) ]
499+ #[ stable ( feature = "iter_once_with" , since = "1.43.0 " ) ]
504500pub fn once_with < A , F : FnOnce ( ) -> A > ( gen : F ) -> OnceWith < F > {
505501 OnceWith { gen : Some ( gen) }
506502}
0 commit comments