mirror of
https://github.com/async-rs/async-std.git
synced 2025-03-27 03:30:25 +00:00
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
|
## Examples
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
use async_std::task;
|
async fn say_hello() {
|
||||||
|
|
||||||
fn main() {
|
|
||||||
task::block_on(async {
|
|
||||||
println!("Hello, world!");
|
println!("Hello, world!");
|
||||||
})
|
}
|
||||||
|
|
||||||
|
#[async_std::main]
|
||||||
|
async fn main() {
|
||||||
|
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…
Reference in a new issue