Skip to content

Glossary: Rust Basics

collect

Also written: collect(), .collect()

A method that gathers the values an iterator hands out into a collection, such as a `Vec<&str>`. The type annotation tells it which kind of collection to build.

Where the book teaches it

Related terms

IteratorVec