Skip to content

Commit 4ac7159

Browse files
committed
core: New closure syntax for comm.rs/task.rs docs
1 parent b913584 commit 4ac7159

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/libcore/comm.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
* let po = comm::port();
1717
* let ch = comm::chan(po);
1818
*
19-
* task::spawn {||
19+
* do task::spawn {
2020
* comm::send(ch, "Hello, World");
21-
* });
21+
* }
2222
*
2323
* io::println(comm::recv(p));
2424
* ~~~

src/libcore/task.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* # Example
1818
*
1919
* ~~~
20-
* spawn {||
20+
* do spawn {
2121
* log(error, "Hello, World!");
2222
* }
2323
* ~~~
@@ -434,7 +434,7 @@ fn spawn_listener<A:send>(+f: fn~(comm::port<A>)) -> comm::chan<A> {
434434
*
435435
* let po = comm::port();
436436
* let ch = comm::chan(po);
437-
* let ch = spawn_listener {|po|
437+
* let ch = do spawn_listener |po| {
438438
* // Now the child has a port called 'po' to read from and
439439
* // an environment-captured channel called 'ch'.
440440
* };
@@ -529,7 +529,7 @@ fn get_task() -> task {
529529
* # Example
530530
*
531531
* ~~~
532-
* task::unkillable {||
532+
* do task::unkillable {
533533
* // detach / yield / destroy must all be called together
534534
* rustrt::rust_port_detach(po);
535535
* // This must not result in the current task being killed

0 commit comments

Comments
 (0)