#007
Feb 5, 2022
7. iter() vs into_iter()
What is the difference between .iter() and .into_iter()?
iter yields &T
into_iter may yield any of T, &T or &mut T based on context.
| |
this works but …
This does not. This results in compile error because cars are moved due to into_iter call.
| |