Skip to content

Latest commit

 

History

History
17 lines (11 loc) · 335 Bytes

iterator-for-each.md

File metadata and controls

17 lines (11 loc) · 335 Bytes

iterator_for_each

The tracking issue for this feature is: #42986


To call a closure on each element of an iterator, you can use for_each:

#![feature(iterator_for_each)]

fn main() {
    (0..10).for_each(|i| println!("{}", i));
}