Skip to content

Commit

Permalink
Changed mutable collected_iterator into immutable
Browse files Browse the repository at this point in the history
`collected_iterator` should be immutable in order for `collected_iterator.push(0)` to produce error.
  • Loading branch information
HomoEfficio authored Jul 13, 2019
1 parent ff21dd4 commit 6262c5c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/std/vec.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ be surpassed, the vector is reallocated with a larger capacity.
```rust,editable,ignore,mdbook-runnable
fn main() {
// Iterators can be collected into vectors
let mut collected_iterator: Vec<i32> = (0..10).collect();
let collected_iterator: Vec<i32> = (0..10).collect();
println!("Collected (0..10) into: {:?}", collected_iterator);
// The `vec!` macro can be used to initialize a vector
Expand Down

0 comments on commit 6262c5c

Please sign in to comment.