2
0
Fork 1
mirror of https://github.com/async-rs/async-std.git synced 2025-01-19 20:13:51 +00:00

Merge pull request #613 from k-nasa/fix_readme

Readme example simply compile
This commit is contained in:
Yoshua Wuyts 2019-12-12 12:03:45 +01:00 committed by GitHub
commit 1103c17e16
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -74,18 +74,15 @@ 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
use async_std::task;
async fn say_hello() { async fn say_hello() {
println!("Hello, world!"); println!("Hello, world!");
} }
#[async_std::main] fn main() {
async fn main() { task::block_on(say_hello())
say_hello().await;
} }
``` ```