forked from mirror/async-std
feedback from review
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
This commit is contained in:
parent
79962e20a5
commit
cffacf7fa3
2 changed files with 8 additions and 2 deletions
|
@ -74,6 +74,10 @@ syntax.
|
||||||
|
|
||||||
## Examples
|
## 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
|
```rust
|
||||||
async fn say_hello() {
|
async fn say_hello() {
|
||||||
println!("Hello, world!");
|
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
|
[`examples`]: https://github.com/async-rs/async-std/tree/master/examples
|
||||||
[documentation]: https://docs.rs/async-std#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
|
## Philosophy
|
||||||
|
|
||||||
|
|
|
@ -154,8 +154,8 @@
|
||||||
//! ```
|
//! ```
|
||||||
//! #[async_std::main]
|
//! #[async_std::main]
|
||||||
//! async fn main() {
|
//! async fn main() {
|
||||||
//! let a = || async move { 1u8 };
|
//! let a = async { 1u8 };
|
||||||
//! let b = || async move { 2u8 };
|
//! let b = async { 2u8 };
|
||||||
//! assert_eq!(a.join(b).await, (1u8, 2u8))
|
//! assert_eq!(a.join(b).await, (1u8, 2u8))
|
||||||
//! }
|
//! }
|
||||||
//! ```
|
//! ```
|
||||||
|
|
Loading…
Reference in a new issue