2
0
Fork 1
mirror of https://github.com/async-rs/async-std.git synced 2025-02-28 15:19:41 +00:00

Merge pull request #52 from skorgu/patch-1

Rename 'task' variable in example
This commit is contained in:
Florian Gilcher 2019-08-16 23:14:28 +02:00 committed by GitHub
commit 9c1869ce62
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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