Help get this topic noticed by sharing it on Twitter, Facebook, or email.

Rust Programming: on mutable vs vectors

This is in reference to the following text in chapter 2:

"
... Vec is Rust’s growable vector type, analogous to C++’s std::vector, a Python list, or a JavaScript array. ... Since we intend to push numbers onto the end of this vector as we parse our command-line arguments, we use the mut keyword to make the vector mutable.
"

Is there a better way to explain or describe things? I'm just having problems trying to reconcile (a) having to use 'mut' with (b) the vector type being a growable type in the first place. Perhaps it's a language design (i.e. making the 'mut' explicit), in which case this should be pointed out as such?
1 person has
this question
+1
Reply