From a97d26ca13d8199440e15d8da954b611f68b7563 Mon Sep 17 00:00:00 2001 From: Stjepan Glavina Date: Sat, 21 Sep 2019 15:22:50 +0200 Subject: [PATCH] Fix imports in the book --- docs/src/concepts/futures.md | 3 +-- docs/src/concepts/tasks.md | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/docs/src/concepts/futures.md b/docs/src/concepts/futures.md index 02a37ba..a23ec07 100644 --- a/docs/src/concepts/futures.md +++ b/docs/src/concepts/futures.md @@ -112,8 +112,7 @@ While the `Future` trait has existed in Rust for a while, it was inconvenient to ```rust,edition2018 # extern crate async_std; -# use async_std::{fs::File, io::Read}; -# use std::io; +# use async_std::{fs::File, io, prelude::*}; # async fn read_file(path: &str) -> Result { let mut file = File::open(path).await?; diff --git a/docs/src/concepts/tasks.md b/docs/src/concepts/tasks.md index 0711c12..15bb82f 100644 --- a/docs/src/concepts/tasks.md +++ b/docs/src/concepts/tasks.md @@ -6,7 +6,7 @@ In `async-std`, the [`tasks`][tasks] module is responsible for this. The simples ```rust,edition2018 # extern crate async_std; -use async_std::{io, task, fs::File, io::Read}; +use async_std::{fs::File, io, prelude::*, task}; async fn read_file(path: &str) -> Result { 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 ```rust,edition2018 # extern crate async_std; -# use async_std::{fs::File, io::Read, task}; -# use std::io; +# use async_std::{fs::File, prelude::*, task}; # # async fn read_file(path: &str) -> Result { # let mut file = File::open(path).await?;