From cffacf7fa32d448a4b0707bfddd51fc0f06d2850 Mon Sep 17 00:00:00 2001 From: Yoshua Wuyts Date: Thu, 21 Nov 2019 21:21:19 +0100 Subject: [PATCH] feedback from review Signed-off-by: Yoshua Wuyts --- README.md | 6 ++++++ src/lib.rs | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3c074fe..34ebe6d 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,10 @@ syntax. ## Examples +All examples require the [`"attributes"` feature] to be enabled. This feature +is not enabled by default because it significantly impacts compile times. See +[`task::block_on`] for an alternative way to start executing tasks. + ```rust async fn say_hello() { println!("Hello, world!"); @@ -90,6 +94,8 @@ More examples, including networking and file access, can be found in our [`examples`]: https://github.com/async-rs/async-std/tree/master/examples [documentation]: https://docs.rs/async-std#examples +[`task::block_on`]: task/fn.block_on.html +[`"attributes"` feature]: https://docs.rs/async-std/#features ## Philosophy diff --git a/src/lib.rs b/src/lib.rs index 5442909..d0c87ff 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -154,8 +154,8 @@ //! ``` //! #[async_std::main] //! async fn main() { -//! let a = || async move { 1u8 }; -//! let b = || async move { 2u8 }; +//! let a = async { 1u8 }; +//! let b = async { 2u8 }; //! assert_eq!(a.join(b).await, (1u8, 2u8)) //! } //! ```