We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dcde1ee commit 0fb1f3fCopy full SHA for 0fb1f3f
src/doc/guide-tasks.md
@@ -89,9 +89,10 @@ closure in the new task.
89
fn print_message() { println!("I am running in a different task!"); }
90
spawn(print_message);
91
92
-// Print something more profound in a different task using a lambda expression
93
-// This uses the proc() keyword to assign to spawn a function with no name
94
-// That function will call println!(...) as requested
+// Print something profound in a different task using a `proc` expression
+// The `proc` expression evaluates to an (unnamed) owned closure.
+// That closure will call `println!(...)` when the spawned task runs.
95
+
96
spawn(proc() println!("I am also running in a different task!") );
97
~~~~
98
0 commit comments