Home

Skip The First N Number Of Items In A Rust Iterator Loop

Use [TODO: Code shorthand span ] on an iterator to start at a place after the first item. For example:

rust
fn main() {
    let source = vec!["alfa", "bravo", "charlie", "delta"];
    source.iter().skip(2).for_each(|x| println!("{}", x));
}
results full
~ fin ~