forked from mirror/async-std
Merge branch 'master' into patch-1
This commit is contained in:
commit
96b821b9f3
1 changed files with 2 additions and 2 deletions
|
@ -17,7 +17,7 @@ async fn read_file(path: &str) -> Result<String, io::Error> {
|
|||
|
||||
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)
|
||||
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue