File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ queue.async(|| println!("World"));
27
27
Concurrent dispatch queues execute tasks concurrently. GCD provides global
28
28
concurrent queues that can be accessed through the ` Queue::global ` function.
29
29
30
- ` Queue ` has two methods that can simplify processing data in parallel, ` apply `
30
+ ` Queue ` has two methods that can simplify processing data in parallel, ` foreach `
31
31
and ` map ` :
32
32
33
33
``` rust
@@ -36,7 +36,7 @@ use dispatch::{Queue, QueuePriority};
36
36
let queue = Queue :: global (QueuePriority :: Default );
37
37
38
38
let mut nums = vec! [1 , 2 ];
39
- queue . apply (& mut nums , | x | * x += 1 );
39
+ queue . foreach (& mut nums , | x | * x += 1 );
40
40
assert! (nums == [2 , 3 ]);
41
41
42
42
let nums = queue . map (nums , | x | x . to_string ());
You can’t perform that action at this time.
0 commit comments