Skip to content

Commit 913ec13

Browse files
committed
update Barrier example to match std::sync::Barrier 1:1
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
1 parent 5881d9a commit 913ec13

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/sync/barrier.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ use crate::sync::Mutex;
88
/// ```
99
/// # fn main() { async_std::task::block_on(async {
1010
/// #
11-
/// use std::sync::Arc;
12-
/// use async_std::sync::Barrier;
11+
/// use async_std::sync::{Arc, Barrier};
1312
/// use async_std::task;
1413
///
1514
/// let mut handles = Vec::with_capacity(10);
@@ -20,14 +19,13 @@ use crate::sync::Mutex;
2019
/// // You will NOT see any interleaving.
2120
/// handles.push(task::spawn(async move {
2221
/// println!("before wait");
23-
/// let wr = c.wait().await;
22+
/// c.wait().await;
2423
/// println!("after wait");
25-
/// wr
2624
/// }));
2725
/// }
2826
/// // Wait for the other futures to finish.
2927
/// for handle in handles {
30-
/// handle.await;
28+
/// handle.await;
3129
/// }
3230
/// # });
3331
/// # }

0 commit comments

Comments
 (0)