Skip to main content

One doc tagged with "iter_mut"

View all tags

Iterating over Collections: The `Iterator` Trait

We've seen how to use for loops to iterate over collections. But how does it actually work? The magic behind for loops is the Iterator trait. In this article, we'll take a closer look at this trait and the different ways you can create an iterator from a collection.