From 77171b5f45faed07ac3347e4b16bdaeba1e5faee Mon Sep 17 00:00:00 2001 From: skorgu Date: Fri, 16 Aug 2019 16:42:21 -0400 Subject: [PATCH] Rename 'task' variable in example The collision between the 'task' variable and the 'task' import is confusing (task::block_on(task) especially). --- docs/src/concepts/tasks.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/src/concepts/tasks.md b/docs/src/concepts/tasks.md index a4238ddc..743d578c 100644 --- a/docs/src/concepts/tasks.md +++ b/docs/src/concepts/tasks.md @@ -15,7 +15,7 @@ async fn read_file(path: &str) -> Result { } fn main() { - let task = task::spawn(async { + let reader_task = task::spawn(async { let result = read_file("data.csv"); match result { Ok(s) => println!("{}", s), @@ -23,7 +23,7 @@ fn main() { } }); println!("Started task!"); - task::block_on(task); + task::block_on(reader_task); println!("Stopped task!"); } ```