Functional Programming

Pure vs Impure Functions

Referential Transparency

iter, into_iter, and iter_mut

fn test_iter() {
    let data = vec![1, 2, 3, 4, 5];

    let it = data.iter();
    println!("{:?}", it);

    let it = data.into_iter();
    println!("{:?}", it);

    let it = data.iter();
    println!("{:?}", it);
}

test_iter();
Error: borrow of moved value: `data`