Prelude to Vectors in the Rust Programming Language
Last Updated: August 6th, 2020
In this post, we are going to explore in detail how to work with resizable arrays in Rust. Specifically, we will take a closer look at the Vector type, its syntax, and some use cases like filtering and transforming a collection.
Responses (1)
Text
A vector can be initialized using the Vec::new function which returns a new empty vector. In order to be able to add elements to it, the new vector variable also needs to be mutable (the mut keyword).
Franchesca Wright4 years ago
I think this paragraph should come before the code box.