polish README.md examples

Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
new-scheduler
Yoshua Wuyts 5 years ago
parent 2dfdc1c482
commit 1431ee0422
No known key found for this signature in database
GPG Key ID: 24EA8164F96777ED

@ -75,19 +75,21 @@ syntax.
## Examples ## Examples
```rust ```rust
use async_std::task; async fn say_hello() {
println!("Hello, world!");
}
fn main() { #[async_std::main]
task::block_on(async { async fn main() {
println!("Hello, world!"); say_hello().await;
})
} }
``` ```
More examples, including networking and file access, can be found in our More examples, including networking and file access, can be found in our
[`examples`] directory. [`examples`] directory and in our [documentation].
[`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
## Philosophy ## Philosophy

Loading…
Cancel
Save