Skip to content

EasyConceptCollections, iterators and memory

How do you iterate over a vector without consuming it?

What a good answer covers

Use iter() or for x in &v, which yields references. into_iter on the vector consumes it.

More on Collections, iterators and memory

Flashcards for this topic