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
```rust
use async_std::task;
async fn say_hello() {
println!("Hello, world!");
}
fn main() {
task::block_on(async {
println!("Hello, world!");
})
#[async_std::main]
async fn main() {
say_hello().await;
}
```
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
[documentation]: https://docs.rs/async-std#examples
## Philosophy

Loading…
Cancel
Save