@@ -171,7 +171,7 @@ use std::time::Duration;
171
171
fn main() {
172
172
let mut data = vec![1u32, 2, 3];
173
173
174
- for i in 0 .. 2 {
174
+ for i in 0.. 2 {
175
175
Thread::spawn(move || {
176
176
data[i] += 1;
177
177
});
@@ -211,7 +211,7 @@ use std::sync::Mutex;
211
211
fn main() {
212
212
let mut data = Mutex::new(vec![1u32, 2, 3]);
213
213
214
- for i in 0 .. 2 {
214
+ for i in 0.. 2 {
215
215
let data = data.lock().unwrap();
216
216
Thread::spawn(move || {
217
217
data[i] += 1;
@@ -262,7 +262,7 @@ use std::time::Duration;
262
262
fn main() {
263
263
let data = Arc::new(Mutex::new(vec![1u32, 2, 3]));
264
264
265
- for i in ( 0us..2) {
265
+ for i in 0us..2 {
266
266
let data = data.clone();
267
267
Thread::spawn(move || {
268
268
let mut data = data.lock().unwrap();
@@ -285,7 +285,7 @@ thread more closely:
285
285
# use std::time::Duration;
286
286
# fn main() {
287
287
# let data = Arc::new(Mutex::new(vec![1u32, 2, 3]));
288
- # for i in ( 0us..2) {
288
+ # for i in 0us..2 {
289
289
# let data = data.clone();
290
290
Thread::spawn(move || {
291
291
let mut data = data.lock().unwrap();
@@ -323,7 +323,7 @@ fn main() {
323
323
324
324
let (tx, rx) = mpsc::channel();
325
325
326
- for _ in ( 0..10) {
326
+ for _ in 0..10 {
327
327
let (data, tx) = (data.clone(), tx.clone());
328
328
329
329
Thread::spawn(move || {
@@ -334,7 +334,7 @@ fn main() {
334
334
});
335
335
}
336
336
337
- for _ in 0 .. 10 {
337
+ for _ in 0.. 10 {
338
338
rx.recv();
339
339
}
340
340
}
0 commit comments