Rollup merge of #22867 - FuGangqiang:master, r=steveklabnik
This commit is contained in:
commit
0775959431
@ -536,7 +536,7 @@ use std::thread::Thread;
|
||||
|
||||
fn main() {
|
||||
let numbers = vec![1, 2, 3];
|
||||
|
||||
|
||||
let guards: Vec<_> = (0..3).map(|i| {
|
||||
Thread::scoped(move || {
|
||||
println!("{}", numbers[i]);
|
||||
@ -565,7 +565,7 @@ while retaining safety. The answer is iterators:
|
||||
```{rust}
|
||||
let vec = vec![1, 2, 3];
|
||||
|
||||
for x in vec.iter() {
|
||||
for x in &vec {
|
||||
println!("{}", x);
|
||||
}
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user