review: explicit async/await
@@ -84,20 +84,21 @@ struct Inner<T> {
/// use futures::channel::oneshot;
/// use std::{thread, time::Duration};
///
-/// fn main() {
/// let (sender, receiver) = oneshot::channel::<i32>();
///
/// thread::spawn(|| {
/// println!("THREAD: sleeping zzz...");
-/// thread::sleep(Duration::from_millis(2000));
+/// thread::sleep(Duration::from_millis(1000));
/// println!("THREAD: i'm awake! sending.");
/// sender.send(3).unwrap();
/// });
///
-/// println!("MAIN: doing some useful stuff; and waiting...");
+/// println!("MAIN: doing some useful stuff");
///
-/// println!("MAIN: got: {:?}", futures::executor::block_on(receiver));
-/// }
+/// futures::executor::block_on(async {
+/// println!("MAIN: waiting for msg...");
+/// println!("MAIN: got: {:?}", receiver.await)
+/// });
/// ```
pub fn channel<T>() -> (Sender<T>, Receiver<T>) {
let inner = Arc::new(Inner::new());
