Skip to content

Commit ad0cdd7

Browse files
committed
Be more clear about what this lambda expression does
1 parent b75683c commit ad0cdd7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/doc/guide-tasks.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ fn print_message() { println!("I am running in a different task!"); }
101101
spawn(print_message);
102102
103103
// Print something more profound in a different task using a lambda expression
104+
// This uses the proc() keyword to assign to spawn a function with no name
105+
// That function will call println!(...) as requested
104106
spawn(proc() println!("I am also running in a different task!") );
105107
~~~~
106108

0 commit comments

Comments
 (0)