Note: This site is currently "Under construction". I'm migrating to a new version of my site building software. Lots of things are in a state of disrepair as a result (for example, footnote links aren't working). It's all part of the process of building in public. Most things should still be readable though.

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

Use `.skip()` on an iterator to start at a place after the first item. For example:

Code

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

Results

charlie
delta

Jump ahead in a Rust loop