IntoIterator
The trait that turns a value into an iterator; for loops call it.
IntoIterator::into_iter converts a value (a Vec, &Vec, a range...) into an iterator; for x in v desugars to a loop over v.into_iter().
Examples
for name in &namesyields&Stringitems and leavesnamesusable;for name in namesyields ownedStrings and movesnamesinto the loop.
See also