Skip to content

Commit a97d26c

Browse files
author
Stjepan Glavina
committed
Fix imports in the book
1 parent 1fa1968 commit a97d26c

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

docs/src/concepts/futures.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,7 @@ While the `Future` trait has existed in Rust for a while, it was inconvenient to
112112

113113
```rust,edition2018
114114
# extern crate async_std;
115-
# use async_std::{fs::File, io::Read};
116-
# use std::io;
115+
# use async_std::{fs::File, io, prelude::*};
117116
#
118117
async fn read_file(path: &str) -> Result<String, io::Error> {
119118
let mut file = File::open(path).await?;

docs/src/concepts/tasks.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ In `async-std`, the [`tasks`][tasks] module is responsible for this. The simples
66

77
```rust,edition2018
88
# extern crate async_std;
9-
use async_std::{io, task, fs::File, io::Read};
9+
use async_std::{fs::File, io, prelude::*, task};
1010
1111
async fn read_file(path: &str) -> Result<String, io::Error> {
1212
let mut file = File::open(path).await?;
@@ -33,8 +33,7 @@ This asks the runtime baked into `async_std` to execute the code that reads a fi
3333

3434
```rust,edition2018
3535
# extern crate async_std;
36-
# use async_std::{fs::File, io::Read, task};
37-
# use std::io;
36+
# use async_std::{fs::File, prelude::*, task};
3837
#
3938
# async fn read_file(path: &str) -> Result<String, io::Error> {
4039
# let mut file = File::open(path).await?;

0 commit comments

Comments
 (0)