From 6262c5c6c91eb847e419b4d7dd479006ed811812 Mon Sep 17 00:00:00 2001 From: Homo Efficio Date: Sat, 13 Jul 2019 22:05:53 +0900 Subject: [PATCH] Changed mutable collected_iterator into immutable `collected_iterator` should be immutable in order for `collected_iterator.push(0)` to produce error. --- 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 6ba442251d..07408fe5b9 100644 --- a/src/std/vec.md +++ b/src/std/vec.md @@ -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 = (0..10).collect(); + let collected_iterator: Vec = (0..10).collect(); println!("Collected (0..10) into: {:?}", collected_iterator); // The `vec!` macro can be used to initialize a vector