Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d7fa0cc

Browse files
polish README.md examples
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
1 parent 2dfdc1c commit d7fa0cc

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

‎README.md‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,19 +75,21 @@ syntax.
7575
## Examples
7676

7777
```rust
78-
use async_std::task;
78+
async fn say_hello() {
79+
println!("Hello, world!");
80+
}
7981

80-
fn main() {
81-
task::block_on(async {
82-
println!("Hello, world!");
83-
})
82+
#[async_std::main]
83+
async fn main() {
84+
say_hello().await;
8485
}
8586
```
8687

8788
More examples, including networking and file access, can be found in our
88-
[`examples`] directory.
89+
[`examples`] directory and on our [docs].
8990

9091
[`examples`]: https://github.com/async-rs/async-std/tree/master/examples
92+
[docs]: https://docs.rs/async-std#examples
9193

9294
## Philosophy
9395

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /