From 728704ac2d7e70e6bdab3438bbdb7dcbaa554e17 Mon Sep 17 00:00:00 2001 From: Shady Khalifa Date: Sat, 17 Aug 2019 13:15:23 +0200 Subject: [PATCH 1/2] missing .await --- docs/src/concepts/tasks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/concepts/tasks.md b/docs/src/concepts/tasks.md index 881dadca6..cb48c0b31 100644 --- a/docs/src/concepts/tasks.md +++ b/docs/src/concepts/tasks.md @@ -17,7 +17,7 @@ async fn read_file(path: &str) -> Result { fn main() { let reader_task = task::spawn(async { - let result = read_file("data.csv"); + let result = read_file("data.csv").await; match result { Ok(s) => println!("{}", s), Err(e) => println!("Error reading file: {:?}", e) From 7836b4d2cb5e25a456e5e6261bc54267f9a9b69f Mon Sep 17 00:00:00 2001 From: Shady Khalifa Date: Sat, 17 Aug 2019 13:18:30 +0200 Subject: [PATCH 2/2] Update tasks.md --- docs/src/concepts/tasks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/concepts/tasks.md b/docs/src/concepts/tasks.md index cb48c0b31..2208d3016 100644 --- a/docs/src/concepts/tasks.md +++ b/docs/src/concepts/tasks.md @@ -33,7 +33,7 @@ This asks the runtime baked into `async_std` to execute the code that reads a fi ```rust async { - let result = read_file("data.csv"); + let result = read_file("data.csv").await; match result { Ok(s) => println!("{}", s), Err(e) => println!("Error reading file: {:?}", e)