forked from mirror/async-std
parent
b768a7bab7
commit
366546b9ce
1 changed files with 2 additions and 3 deletions
|
@ -6,9 +6,8 @@ In `async-std`, the [`tasks`][tasks] module is responsible for this. The simples
|
|||
|
||||
```rust,edition2018
|
||||
# extern crate async_std;
|
||||
# use async_std::{fs::File, io::Read, task};
|
||||
# use std::io;
|
||||
#
|
||||
use async_std::{io, task, fs::File, io::Read};
|
||||
|
||||
async fn read_file(path: &str) -> Result<String, io::Error> {
|
||||
let mut file = File::open(path).await?;
|
||||
let mut contents = String::new();
|
||||
|
|
Loading…
Reference in a new issue