forked from mirror/async-std
polish README.md examples
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
This commit is contained in:
parent
2dfdc1c482
commit
1431ee0422
1 changed files with 8 additions and 6 deletions
14
README.md
14
README.md
|
@ -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…
Reference in a new issue