Merge pull request #52 from skorgu/patch-1

Rename 'task' variable in example
pull/57/head
Florian Gilcher 5 years ago committed by GitHub
commit 9c1869ce62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -15,7 +15,7 @@ async fn read_file(path: &str) -> Result<String, io::Error> {
} }
fn main() { fn main() {
let task = task::spawn(async { let reader_task = task::spawn(async {
let result = read_file("data.csv"); let result = read_file("data.csv");
match result { match result {
Ok(s) => println!("{}", s), Ok(s) => println!("{}", s),
@ -23,7 +23,7 @@ fn main() {
} }
}); });
println!("Started task!"); println!("Started task!");
task::block_on(task); task::block_on(reader_task);
println!("Stopped task!"); println!("Stopped task!");
} }
``` ```

Loading…
Cancel
Save