Skip to content

Commit 9c1869c

Browse files
authored
Merge pull request #52 from skorgu/patch-1
Rename 'task' variable in example
2 parents da44ec5 + 77171b5 commit 9c1869c

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
@@ -15,15 +15,15 @@ async fn read_file(path: &str) -> Result<String, io::Error> {
1515
}
1616

1717
fn main() {
18-
let task = task::spawn(async {
18+
let reader_task = task::spawn(async {
1919
let result = read_file("data.csv");
2020
match result {
2121
Ok(s) => println!("{}", s),
2222
Err(e) => println!("Error reading file: {:?}", e)
2323
}
2424
});
2525
println!("Started task!");
26-
task::block_on(task);
26+
task::block_on(reader_task);
2727
println!("Stopped task!");
2828
}
2929
```

0 commit comments

Comments
 (0)