From d0f45cbfde4a2bb759bca9a4fe8769610224502b Mon Sep 17 00:00:00 2001 From: Samuel Torres <33882985+torressam333@users.noreply.github.com> Date: Tue, 26 Nov 2024 13:23:10 -0800 Subject: [PATCH] Update vec.md Without `mut` before the `collected_iterator` variable the compiler throws an error when the program is ran. --- src/std/vec.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/std/vec.md b/src/std/vec.md index e8cf2447e8..0cf13a40ec 100644 --- a/src/std/vec.md +++ b/src/std/vec.md @@ -15,7 +15,7 @@ needs to be surpassed, the vector is reallocated with a larger capacity. ```rust,editable,ignore,mdbook-runnable fn main() { // Iterators can be collected into vectors - let collected_iterator: Vec = (0..10).collect(); + let mut collected_iterator: Vec = (0..10).collect(); println!("Collected (0..10) into: {:?}", collected_iterator); // The `vec!` macro can be used to initialize a vector