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.
8989fn print_message() { println!("I am running in a different task!"); }
9090spawn(print_message);
9191
92- // Print something profound in a different task using a `proc` expression
92+ // Alternatively, use a `proc` expression instead of a named function.
9393// The `proc` expression evaluates to an (unnamed) owned closure.
9494// That closure will call `println!(...)` when the spawned task runs.
95-
9695spawn(proc() println!("I am also running in a different task!") );
9796~~~~
9897
@@ -352,14 +351,14 @@ fn main() {
352351
353352The function ` pnorm ` performs a simple computation on the vector (it computes the sum of its items
354353at 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:
356355
357356~~~
358357# use std::rand;
359358# use std::sync::Arc;
360359# fn main() {
361360# let numbers = Vec::from_fn(1000000, |_| rand::random::<f64>());
362- let numbers_arc= Arc::new(numbers);
361+ let numbers_arc = Arc::new(numbers);
363362# }
364363~~~
365364
You can’t perform that action at this time.
0 commit comments