4 ms·
The book "Programming Rust" (very good book btw) only mentions iter() and iter_mut() briefly and focuses on into_iter because the IntoIterator trait only implem
by friedman23 4y ago
The book "Programming Rust" (very good book btw) only mentions iter() and iter_mut() briefly and focuses on into_iter because the IntoIterator trait only implements into_iter.
You can replicate iter() with `(&x).into_iter()`
and you can replicate iter_mut() with `(&mut x).into_iter()`
and obviously `x.into_iter()` consumes the contents.