change to iterate over &vet
This commit is contained in:
parent
05bdfe8e2e
commit
69bfb6f717
1 changed files with 1 additions and 1 deletions
|
|
@ -565,7 +565,7 @@ while retaining safety. The answer is iterators:
|
|||
```{rust}
|
||||
let vec = vec![1, 2, 3];
|
||||
|
||||
for x in vec {
|
||||
for x in &vec {
|
||||
println!("{}", x);
|
||||
}
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue