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 fd0b4d4

Browse files
Shady KhalifaStjepan Glavina
Shady Khalifa
authored and
Stjepan Glavina
committed
missing .await (#69)
* missing .await * Update tasks.md
1 parent 2ef1a76 commit fd0b4d4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎docs/src/concepts/tasks.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ async fn read_file(path: &str) -> Result<String, io::Error> {
1717

1818
fn main() {
1919
let reader_task = task::spawn(async {
20-
let result = read_file("data.csv");
20+
let result = read_file("data.csv").await;
2121
match result {
2222
Ok(s) => println!("{}", s),
2323
Err(e) => println!("Error reading file: {:?}", e)
@@ -33,7 +33,7 @@ This asks the runtime baked into `async_std` to execute the code that reads a fi
3333

3434
```rust
3535
async {
36-
let result = read_file("data.csv");
36+
let result = read_file("data.csv").await;
3737
match result {
3838
Ok(s) => println!("{}", s),
3939
Err(e) => println!("Error reading file: {:?}", e)

0 commit comments

Comments
(0)

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