Rollup merge of #57579 - stjepang:once-with, r=SimonSapin
Add core::iter::once_with() Functions `iter::once()` and `iter::repeat()` construct iterators from values. The latter has the lazy variant `iter::repeat_with()`, but the former doesn't. This PR therefore adds `iter::once_with()`. Another way to think of `iter::once_with()` is that it's a function that converts `FnOnce() -> T` into `Iterator<Item = T>`. If this seems like a reasonable addition, I'll open a tracking issue and update the `#[feature(...)]` attributes.
This commit is contained in:
@@ -79,6 +79,7 @@
|
||||
#![feature(extern_types)]
|
||||
#![feature(fundamental)]
|
||||
#![feature(intrinsics)]
|
||||
#![feature(iter_once_with)]
|
||||
#![feature(lang_items)]
|
||||
#![feature(link_llvm_intrinsics)]
|
||||
#![feature(never_type)]
|
||||
|
||||
Reference in New Issue
Block a user