Skip to content

Commit d0f45cb

Browse files
authored
Update vec.md
Without `mut` before the `collected_iterator` variable the compiler throws an error when the program is ran.
1 parent e1d1f2c commit d0f45cb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/std/vec.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ needs to be surpassed, the vector is reallocated with a larger capacity.
1515
```rust,editable,ignore,mdbook-runnable
1616
fn main() {
1717
// Iterators can be collected into vectors
18-
let collected_iterator: Vec<i32> = (0..10).collect();
18+
let mut collected_iterator: Vec<i32> = (0..10).collect();
1919
println!("Collected (0..10) into: {:?}", collected_iterator);
2020
2121
// The `vec!` macro can be used to initialize a vector

0 commit comments

Comments
 (0)