Skip to content

Commit 45d633d

Browse files
committed
Rollup merge of rust-lang#32605 - tshepang:not-needed, r=Manishearth
doc: "mut" not needed for the examples
2 parents 662e7af + cd92e9f commit 45d633d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/doc/book/vectors.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ You can iterate the vector multiple times by taking a reference to the vector wh
120120
For example, the following code does not compile.
121121

122122
```rust,ignore
123-
let mut v = vec![1, 2, 3, 4, 5];
123+
let v = vec![1, 2, 3, 4, 5];
124124
125125
for i in v {
126126
println!("Take ownership of the vector and its element {}", i);
@@ -134,7 +134,7 @@ for i in v {
134134
Whereas the following works perfectly,
135135

136136
```rust
137-
let mut v = vec![1, 2, 3, 4, 5];
137+
let v = vec![1, 2, 3, 4, 5];
138138

139139
for i in &v {
140140
println!("This is a reference to {}", i);

0 commit comments

Comments
 (0)