diff --git a/docs/src/concepts/futures.md b/docs/src/concepts/futures.md index 05cc0400..67db720c 100644 --- a/docs/src/concepts/futures.md +++ b/docs/src/concepts/futures.md @@ -67,7 +67,7 @@ Note that this return value talks about the past. The past has a drawback: all d But we wanted to abstract over *computation* and let someone else choose how to run it. That's fundamentally incompatible with looking at the results of previous computation all the time. So, let's find a type that *describes* a computation without running it. Let's look at the function again: ```rust,edition2018 -# use std::{fs::File, io::{self, Read}}; +# use std::{fs::File, io, io::prelude::*}; # fn read_file(path: &str) -> io::Result { let mut file = File::open(path)?; diff --git a/docs/src/tutorial/accept_loop.md b/docs/src/tutorial/accept_loop.md index 96c15bac..50a6b5fe 100644 --- a/docs/src/tutorial/accept_loop.md +++ b/docs/src/tutorial/accept_loop.md @@ -29,7 +29,7 @@ Now we can write the server's accept loop: # extern crate async_std; # use async_std::{ # net::{TcpListener, ToSocketAddrs}, -# prelude::Stream, +# prelude::*, # }; # # type Result = std::result::Result>; @@ -66,7 +66,7 @@ Finally, let's add main: # extern crate async_std; # use async_std::{ # net::{TcpListener, ToSocketAddrs}, -# prelude::Stream, +# prelude::*, # task, # }; # diff --git a/docs/src/tutorial/connecting_readers_and_writers.md b/docs/src/tutorial/connecting_readers_and_writers.md index d5da471a..5f98ac21 100644 --- a/docs/src/tutorial/connecting_readers_and_writers.md +++ b/docs/src/tutorial/connecting_readers_and_writers.md @@ -15,9 +15,8 @@ The order of events "Bob sends message to Alice" and "Alice joins" is determined # extern crate futures_channel; # extern crate futures_util; # use async_std::{ -# io::{Write}, # net::TcpStream, -# prelude::{Future, Stream}, +# prelude::*, # task, # }; # use futures_channel::mpsc; diff --git a/docs/src/tutorial/handling_disconnection.md b/docs/src/tutorial/handling_disconnection.md index 27c50523..9d7c5728 100644 --- a/docs/src/tutorial/handling_disconnection.md +++ b/docs/src/tutorial/handling_disconnection.md @@ -72,7 +72,7 @@ We use the `select` macro for this purpose: # extern crate async_std; # extern crate futures_channel; # extern crate futures_util; -# use async_std::{io::Write, net::TcpStream}; +# use async_std::{net::TcpStream, prelude::*}; use futures_channel::mpsc; use futures_util::{select, FutureExt, StreamExt}; # use std::sync::Arc; @@ -125,8 +125,9 @@ The final code looks like this: # extern crate futures_channel; # extern crate futures_util; use async_std::{ - io::{BufReader, BufRead, Write}, + io::BufReader, net::{TcpListener, TcpStream, ToSocketAddrs}, + prelude::*, task, }; use futures_channel::mpsc; diff --git a/docs/src/tutorial/implementing_a_client.md b/docs/src/tutorial/implementing_a_client.md index a3ba93a3..8eab22fb 100644 --- a/docs/src/tutorial/implementing_a_client.md +++ b/docs/src/tutorial/implementing_a_client.md @@ -18,8 +18,9 @@ With async, we can just use the `select!` macro. # extern crate async_std; # extern crate futures_util; use async_std::{ - io::{stdin, BufRead, BufReader, Write}, + io::{stdin, BufReader}, net::{TcpStream, ToSocketAddrs}, + prelude::*, task, }; use futures_util::{select, FutureExt, StreamExt}; diff --git a/docs/src/tutorial/receiving_messages.md b/docs/src/tutorial/receiving_messages.md index 667cf1cf..182e55c8 100644 --- a/docs/src/tutorial/receiving_messages.md +++ b/docs/src/tutorial/receiving_messages.md @@ -10,9 +10,9 @@ We need to: ```rust,edition2018 # extern crate async_std; # use async_std::{ -# io::{BufRead, BufReader}, +# io::BufReader, # net::{TcpListener, TcpStream, ToSocketAddrs}, -# prelude::Stream, +# prelude::*, # task, # }; # @@ -75,9 +75,9 @@ We can "fix" it by waiting for the task to be joined, like this: # #![feature(async_closure)] # extern crate async_std; # use async_std::{ -# io::{BufRead, BufReader}, +# io::BufReader, # net::{TcpListener, TcpStream, ToSocketAddrs}, -# prelude::Stream, +# prelude::*, # task, # }; # @@ -125,7 +125,7 @@ So let's use a helper function for this: # extern crate async_std; # use async_std::{ # io, -# prelude::Future, +# prelude::*, # task, # }; fn spawn_and_log_error(fut: F) -> task::JoinHandle<()> diff --git a/docs/src/tutorial/sending_messages.md b/docs/src/tutorial/sending_messages.md index 6fec8c9f..028970e5 100644 --- a/docs/src/tutorial/sending_messages.md +++ b/docs/src/tutorial/sending_messages.md @@ -16,9 +16,8 @@ if Alice and Charley send two messages to Bob at the same time, Bob will see the # extern crate futures_channel; # extern crate futures_util; # use async_std::{ -# io::Write, # net::TcpStream, -# prelude::Stream, +# prelude::*, # }; use futures_channel::mpsc; // 1 use futures_util::sink::SinkExt;