Skip to content

Commit fd86043

Browse files
committed
Rollup merge of #22324 - Manishearth:patch-1, r=steveklabnik
(fixes #22317) rollupable
2 parents ca7cc26 + 657081b commit fd86043

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/doc/trpl/concurrency.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ use std::time::Duration;
171171
fn main() {
172172
let mut data = vec![1u32, 2, 3];
173173
174-
for i in 0 .. 2 {
174+
for i in 0..2 {
175175
Thread::spawn(move || {
176176
data[i] += 1;
177177
});
@@ -211,7 +211,7 @@ use std::sync::Mutex;
211211
fn main() {
212212
let mut data = Mutex::new(vec![1u32, 2, 3]);
213213
214-
for i in 0 .. 2 {
214+
for i in 0..2 {
215215
let data = data.lock().unwrap();
216216
Thread::spawn(move || {
217217
data[i] += 1;
@@ -262,7 +262,7 @@ use std::time::Duration;
262262
fn main() {
263263
let data = Arc::new(Mutex::new(vec![1u32, 2, 3]));
264264
265-
for i in (0us..2) {
265+
for i in 0us..2 {
266266
let data = data.clone();
267267
Thread::spawn(move || {
268268
let mut data = data.lock().unwrap();
@@ -285,7 +285,7 @@ thread more closely:
285285
# use std::time::Duration;
286286
# fn main() {
287287
# let data = Arc::new(Mutex::new(vec![1u32, 2, 3]));
288-
# for i in (0us..2) {
288+
# for i in 0us..2 {
289289
# let data = data.clone();
290290
Thread::spawn(move || {
291291
let mut data = data.lock().unwrap();
@@ -323,7 +323,7 @@ fn main() {
323323
324324
let (tx, rx) = mpsc::channel();
325325
326-
for _ in (0..10) {
326+
for _ in 0..10 {
327327
let (data, tx) = (data.clone(), tx.clone());
328328
329329
Thread::spawn(move || {
@@ -334,7 +334,7 @@ fn main() {
334334
});
335335
}
336336
337-
for _ in 0 .. 10 {
337+
for _ in 0..10 {
338338
rx.recv();
339339
}
340340
}

0 commit comments

Comments
 (0)