Use Iterators

Source: https://cheats.rs/#idiomatic-rust

Use iterators whenever possible.

Don't write:

fn main() {
    let a = [0, 1, 2, 3, 4];
    let mut i = 0;

    while i < a.len() {
        println!("{}", a[i]);
        i += 1;
    }
}

Do write:

fn main() {
    let a = [0, 1, 2, 3, 4];

    for e in a {
        println!("{}", e);
    }
}