File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -89,10 +89,9 @@ closure in the new task.
89
89
fn print_message() { println!("I am running in a different task!"); }
90
90
spawn(print_message);
91
91
92
- // Print something profound in a different task using a `proc` expression
92
+ // Alternatively, use a `proc` expression instead of a named function.
93
93
// The `proc` expression evaluates to an (unnamed) owned closure.
94
94
// That closure will call `println!(...)` when the spawned task runs.
95
-
96
95
spawn(proc() println!("I am also running in a different task!") );
97
96
~~~~
98
97
@@ -352,14 +351,14 @@ fn main() {
352
351
353
352
The function ` pnorm ` performs a simple computation on the vector (it computes the sum of its items
354
353
at the power given as argument and takes the inverse power of this value). The Arc on the vector is
355
- created by the line
354
+ created by the line:
356
355
357
356
~~~
358
357
# use std::rand;
359
358
# use std::sync::Arc;
360
359
# fn main() {
361
360
# let numbers = Vec::from_fn(1000000, |_| rand::random::<f64>());
362
- let numbers_arc= Arc::new(numbers);
361
+ let numbers_arc = Arc::new(numbers);
363
362
# }
364
363
~~~
365
364
You can’t perform that action at this time.
0 commit comments