@@ -399,12 +399,12 @@ pub fn once<T>(value: T) -> Once<T> {
399
399
///
400
400
/// [`once_with`]: fn.once_with.html
401
401
#[ derive( Copy , Clone , Debug ) ]
402
- #[ unstable ( feature = "iter_once_with" , issue = "57581 " ) ]
402
+ #[ stable ( feature = "iter_once_with" , since = "1.43.0 " ) ]
403
403
pub struct OnceWith < F > {
404
404
gen : Option < F > ,
405
405
}
406
406
407
- #[ unstable ( feature = "iter_once_with" , issue = "57581 " ) ]
407
+ #[ stable ( feature = "iter_once_with" , since = "1.43.0 " ) ]
408
408
impl < A , F : FnOnce ( ) -> A > Iterator for OnceWith < F > {
409
409
type Item = A ;
410
410
@@ -420,24 +420,24 @@ impl<A, F: FnOnce() -> A> Iterator for OnceWith<F> {
420
420
}
421
421
}
422
422
423
- #[ unstable ( feature = "iter_once_with" , issue = "57581 " ) ]
423
+ #[ stable ( feature = "iter_once_with" , since = "1.43.0 " ) ]
424
424
impl < A , F : FnOnce ( ) -> A > DoubleEndedIterator for OnceWith < F > {
425
425
fn next_back ( & mut self ) -> Option < A > {
426
426
self . next ( )
427
427
}
428
428
}
429
429
430
- #[ unstable ( feature = "iter_once_with" , issue = "57581 " ) ]
430
+ #[ stable ( feature = "iter_once_with" , since = "1.43.0 " ) ]
431
431
impl < A , F : FnOnce ( ) -> A > ExactSizeIterator for OnceWith < F > {
432
432
fn len ( & self ) -> usize {
433
433
self . gen . iter ( ) . len ( )
434
434
}
435
435
}
436
436
437
- #[ unstable ( feature = "iter_once_with" , issue = "57581 " ) ]
437
+ #[ stable ( feature = "iter_once_with" , since = "1.43.0 " ) ]
438
438
impl < A , F : FnOnce ( ) -> A > FusedIterator for OnceWith < F > { }
439
439
440
- #[ unstable ( feature = "iter_once_with" , issue = "57581 " ) ]
440
+ #[ stable ( feature = "iter_once_with" , since = "1.43.0 " ) ]
441
441
unsafe impl < A , F : FnOnce ( ) -> A > TrustedLen for OnceWith < F > { }
442
442
443
443
/// 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> {}
458
458
/// Basic usage:
459
459
///
460
460
/// ```
461
- /// #![feature(iter_once_with)]
462
- ///
463
461
/// use std::iter;
464
462
///
465
463
/// // one is the loneliest number
@@ -476,8 +474,6 @@ unsafe impl<A, F: FnOnce() -> A> TrustedLen for OnceWith<F> {}
476
474
/// `.foorc`:
477
475
///
478
476
/// ```no_run
479
- /// #![feature(iter_once_with)]
480
- ///
481
477
/// use std::iter;
482
478
/// use std::fs;
483
479
/// use std::path::PathBuf;
@@ -500,7 +496,7 @@ unsafe impl<A, F: FnOnce() -> A> TrustedLen for OnceWith<F> {}
500
496
/// }
501
497
/// ```
502
498
#[ inline]
503
- #[ unstable ( feature = "iter_once_with" , issue = "57581 " ) ]
499
+ #[ stable ( feature = "iter_once_with" , since = "1.43.0 " ) ]
504
500
pub fn once_with < A , F : FnOnce ( ) -> A > ( gen : F ) -> OnceWith < F > {
505
501
OnceWith { gen : Some ( gen) }
506
502
}
0 commit comments