Rust 1.48.0-nightly
1fd5b9d51

# Iterators

There is a new edition of the book and this is an old link.

> The iterator pattern allows you to perform some task on a sequence of items in turn. An iterator is responsible for the logic of iterating over each item and determining when the sequence has finished.

    let v1 = vec![1, 2, 3];

    let v1_iter = v1.iter();

    for val in v1_iter {
        println!("Got: {}", val);
    }

Run

Here are the relevant sections in the new and old books:

- in the current edition: Ch 13.02 — Iterators
- In the first edition: Ch 4.5 — Iterators