diff --git a/README.md b/README.md index 68ebc68e8..ecc87018c 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ A basic TCP echo server with Tokio: ```rust,no_run use tokio::net::TcpListener; -use tokio::prelude::*; +use tokio::io::{AsyncReadExt, AsyncWriteExt}; #[tokio::main] async fn main() -> Result<(), Box> { diff --git a/tokio-util/src/codec/length_delimited.rs b/tokio-util/src/codec/length_delimited.rs index 2426b771a..ef706dfab 100644 --- a/tokio-util/src/codec/length_delimited.rs +++ b/tokio-util/src/codec/length_delimited.rs @@ -39,7 +39,7 @@ //! Specifically, given the following: //! //! ``` -//! use tokio::prelude::*; +//! use tokio::io::{AsyncRead, AsyncWrite}; //! use tokio_util::codec::{Framed, LengthDelimitedCodec}; //! //! use futures::SinkExt; diff --git a/tokio-util/tests/framed.rs b/tokio-util/tests/framed.rs index 7e39e266a..54d78d9d2 100644 --- a/tokio-util/tests/framed.rs +++ b/tokio-util/tests/framed.rs @@ -1,6 +1,5 @@ #![warn(rust_2018_idioms)] -use tokio::prelude::*; use tokio_stream::StreamExt; use tokio_test::assert_ok; use tokio_util::codec::{Decoder, Encoder, Framed, FramedParts}; @@ -52,7 +51,7 @@ impl Read for DontReadIntoThis { } } -impl AsyncRead for DontReadIntoThis { +impl tokio::io::AsyncRead for DontReadIntoThis { fn poll_read( self: Pin<&mut Self>, _cx: &mut Context<'_>, diff --git a/tokio/README.md b/tokio/README.md index fb41b18da..5896cb747 100644 --- a/tokio/README.md +++ b/tokio/README.md @@ -55,7 +55,7 @@ A basic TCP echo server with Tokio: ```rust,no_run use tokio::net::TcpListener; -use tokio::prelude::*; +use tokio::io::{AsyncReadExt, AsyncWriteExt}; #[tokio::main] async fn main() -> Result<(), Box> { diff --git a/tokio/src/fs/file.rs b/tokio/src/fs/file.rs index 7c71f4831..5c06e732b 100644 --- a/tokio/src/fs/file.rs +++ b/tokio/src/fs/file.rs @@ -37,8 +37,7 @@ use std::task::Poll::*; /// the data to disk. /// /// Reading and writing to a `File` is usually done using the convenience -/// methods found on the [`AsyncReadExt`] and [`AsyncWriteExt`] traits. Examples -/// import these traits through [the prelude]. +/// methods found on the [`AsyncReadExt`] and [`AsyncWriteExt`] traits. /// /// [std]: struct@std::fs::File /// [`AsyncSeek`]: trait@crate::io::AsyncSeek @@ -46,7 +45,6 @@ use std::task::Poll::*; /// [`sync_all`]: fn@crate::fs::File::sync_all /// [`AsyncReadExt`]: trait@crate::io::AsyncReadExt /// [`AsyncWriteExt`]: trait@crate::io::AsyncWriteExt -/// [the prelude]: crate::prelude /// /// # Examples /// @@ -54,7 +52,7 @@ use std::task::Poll::*; /// /// ```no_run /// use tokio::fs::File; -/// use tokio::prelude::*; // for write_all() +/// use tokio::io::AsyncWriteExt; // for write_all() /// /// # async fn dox() -> std::io::Result<()> { /// let mut file = File::create("foo.txt").await?; @@ -67,7 +65,7 @@ use std::task::Poll::*; /// /// ```no_run /// use tokio::fs::File; -/// use tokio::prelude::*; // for read_to_end() +/// use tokio::io::AsyncReadExt; // for read_to_end() /// /// # async fn dox() -> std::io::Result<()> { /// let mut file = File::open("foo.txt").await?; @@ -125,7 +123,7 @@ impl File { /// /// ```no_run /// use tokio::fs::File; - /// use tokio::prelude::*; + /// use tokio::io::AsyncReadExt; /// /// # async fn dox() -> std::io::Result<()> { /// let mut file = File::open("foo.txt").await?; @@ -169,7 +167,7 @@ impl File { /// /// ```no_run /// use tokio::fs::File; - /// use tokio::prelude::*; + /// use tokio::io::AsyncWriteExt; /// /// # async fn dox() -> std::io::Result<()> { /// let mut file = File::create("foo.txt").await?; @@ -221,7 +219,7 @@ impl File { /// /// ```no_run /// use tokio::fs::File; - /// use tokio::prelude::*; + /// use tokio::io::AsyncWriteExt; /// /// # async fn dox() -> std::io::Result<()> { /// let mut file = File::create("foo.txt").await?; @@ -256,7 +254,7 @@ impl File { /// /// ```no_run /// use tokio::fs::File; - /// use tokio::prelude::*; + /// use tokio::io::AsyncWriteExt; /// /// # async fn dox() -> std::io::Result<()> { /// let mut file = File::create("foo.txt").await?; @@ -294,7 +292,7 @@ impl File { /// /// ```no_run /// use tokio::fs::File; - /// use tokio::prelude::*; + /// use tokio::io::AsyncWriteExt; /// /// # async fn dox() -> std::io::Result<()> { /// let mut file = File::create("foo.txt").await?; diff --git a/tokio/src/io/util/async_read_ext.rs b/tokio/src/io/util/async_read_ext.rs index 1f918f197..ebcbce646 100644 --- a/tokio/src/io/util/async_read_ext.rs +++ b/tokio/src/io/util/async_read_ext.rs @@ -39,11 +39,9 @@ cfg_io_util! { /// [`AsyncRead`] types. Callers will tend to import this trait instead of /// [`AsyncRead`]. /// - /// As a convenience, this trait may be imported using the [`prelude`]: - /// /// ```no_run /// use tokio::fs::File; - /// use tokio::prelude::*; + /// use tokio::io::{self, AsyncReadExt}; /// /// #[tokio::main] /// async fn main() -> io::Result<()> { @@ -60,7 +58,6 @@ cfg_io_util! { /// See [module][crate::io] documentation for more details. /// /// [`AsyncRead`]: AsyncRead - /// [`prelude`]: crate::prelude pub trait AsyncReadExt: AsyncRead { /// Creates a new `AsyncRead` instance that chains this stream with /// `next`. diff --git a/tokio/src/io/util/async_seek_ext.rs b/tokio/src/io/util/async_seek_ext.rs index 351900bd8..813913fdc 100644 --- a/tokio/src/io/util/async_seek_ext.rs +++ b/tokio/src/io/util/async_seek_ext.rs @@ -3,15 +3,13 @@ use crate::io::AsyncSeek; use std::io::SeekFrom; cfg_io_util! { - /// An extension trait which adds utility methods to [`AsyncSeek`] types. - /// - /// As a convenience, this trait may be imported using the [`prelude`]: + /// An extension trait that adds utility methods to [`AsyncSeek`] types. /// /// # Examples /// /// ``` - /// use std::io::{Cursor, SeekFrom}; - /// use tokio::prelude::*; + /// use std::io::{self, Cursor, SeekFrom}; + /// use tokio::io::{AsyncSeekExt, AsyncReadExt}; /// /// #[tokio::main] /// async fn main() -> io::Result<()> { @@ -32,7 +30,6 @@ cfg_io_util! { /// See [module][crate::io] documentation for more details. /// /// [`AsyncSeek`]: AsyncSeek - /// [`prelude`]: crate::prelude pub trait AsyncSeekExt: AsyncSeek { /// Creates a future which will seek an IO object, and then yield the /// new position in the object and the object itself. @@ -50,7 +47,7 @@ cfg_io_util! { /// /// ```no_run /// use tokio::fs::File; - /// use tokio::prelude::*; + /// use tokio::io::{AsyncSeekExt, AsyncReadExt}; /// /// use std::io::SeekFrom; /// diff --git a/tokio/src/io/util/async_write_ext.rs b/tokio/src/io/util/async_write_ext.rs index e6ef5b204..dc500f2f2 100644 --- a/tokio/src/io/util/async_write_ext.rs +++ b/tokio/src/io/util/async_write_ext.rs @@ -39,10 +39,8 @@ cfg_io_util! { /// [`AsyncWrite`] types. Callers will tend to import this trait instead of /// [`AsyncWrite`]. /// - /// As a convenience, this trait may be imported using the [`prelude`]: - /// /// ```no_run - /// use tokio::prelude::*; + /// use tokio::io::{self, AsyncWriteExt}; /// use tokio::fs::File; /// /// #[tokio::main] @@ -64,7 +62,6 @@ cfg_io_util! { /// See [module][crate::io] documentation for more details. /// /// [`AsyncWrite`]: AsyncWrite - /// [`prelude`]: crate::prelude pub trait AsyncWriteExt: AsyncWrite { /// Writes a buffer into this writer, returning how many bytes were /// written. diff --git a/tokio/src/lib.rs b/tokio/src/lib.rs index 70ec0b4a2..0cc004dd0 100644 --- a/tokio/src/lib.rs +++ b/tokio/src/lib.rs @@ -254,7 +254,7 @@ //! //! ```no_run //! use tokio::net::TcpListener; -//! use tokio::prelude::*; +//! use tokio::io::{AsyncReadExt, AsyncWriteExt}; //! //! #[tokio::main] //! async fn main() -> Result<(), Box> { @@ -363,8 +363,6 @@ pub mod net; mod loom; mod park; -pub mod prelude; - cfg_process! { pub mod process; } diff --git a/tokio/src/net/tcp/split.rs b/tokio/src/net/tcp/split.rs index 296b469d4..f1d71a6d8 100644 --- a/tokio/src/net/tcp/split.rs +++ b/tokio/src/net/tcp/split.rs @@ -20,12 +20,11 @@ use std::task::{Context, Poll}; /// Borrowed read half of a [`TcpStream`], created by [`split`]. /// /// Reading from a `ReadHalf` is usually done using the convenience methods found on the -/// [`AsyncReadExt`] trait. Examples import this trait through [the prelude]. +/// [`AsyncReadExt`] trait. /// /// [`TcpStream`]: TcpStream /// [`split`]: TcpStream::split() /// [`AsyncReadExt`]: trait@crate::io::AsyncReadExt -/// [the prelude]: crate::prelude #[derive(Debug)] pub struct ReadHalf<'a>(&'a TcpStream); @@ -35,14 +34,13 @@ pub struct ReadHalf<'a>(&'a TcpStream); /// shut down the TCP stream in the write direction. /// /// Writing to an `WriteHalf` is usually done using the convenience methods found -/// on the [`AsyncWriteExt`] trait. Examples import this trait through [the prelude]. +/// on the [`AsyncWriteExt`] trait. /// /// [`TcpStream`]: TcpStream /// [`split`]: TcpStream::split() /// [`AsyncWrite`]: trait@crate::io::AsyncWrite /// [`poll_shutdown`]: fn@crate::io::AsyncWrite::poll_shutdown /// [`AsyncWriteExt`]: trait@crate::io::AsyncWriteExt -/// [the prelude]: crate::prelude #[derive(Debug)] pub struct WriteHalf<'a>(&'a TcpStream); @@ -101,7 +99,7 @@ impl ReadHalf<'_> { /// /// ```no_run /// use tokio::net::TcpStream; - /// use tokio::prelude::*; + /// use tokio::io::AsyncReadExt; /// use std::error::Error; /// /// #[tokio::main] diff --git a/tokio/src/net/tcp/split_owned.rs b/tokio/src/net/tcp/split_owned.rs index 725d7411e..65fe2223e 100644 --- a/tokio/src/net/tcp/split_owned.rs +++ b/tokio/src/net/tcp/split_owned.rs @@ -22,12 +22,11 @@ use std::{fmt, io}; /// Owned read half of a [`TcpStream`], created by [`into_split`]. /// /// Reading from an `OwnedReadHalf` is usually done using the convenience methods found -/// on the [`AsyncReadExt`] trait. Examples import this trait through [the prelude]. +/// on the [`AsyncReadExt`] trait. /// /// [`TcpStream`]: TcpStream /// [`into_split`]: TcpStream::into_split() /// [`AsyncReadExt`]: trait@crate::io::AsyncReadExt -/// [the prelude]: crate::prelude #[derive(Debug)] pub struct OwnedReadHalf { inner: Arc, @@ -40,14 +39,13 @@ pub struct OwnedReadHalf { /// will also shut down the write half of the TCP stream. /// /// Writing to an `OwnedWriteHalf` is usually done using the convenience methods found -/// on the [`AsyncWriteExt`] trait. Examples import this trait through [the prelude]. +/// on the [`AsyncWriteExt`] trait. /// /// [`TcpStream`]: TcpStream /// [`into_split`]: TcpStream::into_split() /// [`AsyncWrite`]: trait@crate::io::AsyncWrite /// [`poll_shutdown`]: fn@crate::io::AsyncWrite::poll_shutdown /// [`AsyncWriteExt`]: trait@crate::io::AsyncWriteExt -/// [the prelude]: crate::prelude #[derive(Debug)] pub struct OwnedWriteHalf { inner: Arc, @@ -156,7 +154,7 @@ impl OwnedReadHalf { /// /// ```no_run /// use tokio::net::TcpStream; - /// use tokio::prelude::*; + /// use tokio::io::AsyncReadExt; /// use std::error::Error; /// /// #[tokio::main] diff --git a/tokio/src/net/tcp/stream.rs b/tokio/src/net/tcp/stream.rs index 56948ffa6..a2bba6311 100644 --- a/tokio/src/net/tcp/stream.rs +++ b/tokio/src/net/tcp/stream.rs @@ -25,20 +25,19 @@ cfg_net! { /// /// Reading and writing to a `TcpStream` is usually done using the /// convenience methods found on the [`AsyncReadExt`] and [`AsyncWriteExt`] - /// traits. Examples import these traits through [the prelude]. + /// traits. /// /// [`connect`]: method@TcpStream::connect /// [accepting]: method@crate::net::TcpListener::accept /// [listener]: struct@crate::net::TcpListener /// [`AsyncReadExt`]: trait@crate::io::AsyncReadExt /// [`AsyncWriteExt`]: trait@crate::io::AsyncWriteExt - /// [the prelude]: crate::prelude /// /// # Examples /// /// ```no_run /// use tokio::net::TcpStream; - /// use tokio::prelude::*; + /// use tokio::io::AsyncWriteExt; /// use std::error::Error; /// /// #[tokio::main] @@ -81,7 +80,7 @@ impl TcpStream { /// /// ```no_run /// use tokio::net::TcpStream; - /// use tokio::prelude::*; + /// use tokio::io::AsyncWriteExt; /// use std::error::Error; /// /// #[tokio::main] @@ -648,7 +647,7 @@ impl TcpStream { /// /// ```no_run /// use tokio::net::TcpStream; - /// use tokio::prelude::*; + /// use tokio::io::AsyncReadExt; /// use std::error::Error; /// /// #[tokio::main] diff --git a/tokio/src/net/unix/split.rs b/tokio/src/net/unix/split.rs index af9c76249..46849e369 100644 --- a/tokio/src/net/unix/split.rs +++ b/tokio/src/net/unix/split.rs @@ -19,12 +19,11 @@ use std::task::{Context, Poll}; /// Borrowed read half of a [`UnixStream`], created by [`split`]. /// /// Reading from a `ReadHalf` is usually done using the convenience methods found on the -/// [`AsyncReadExt`] trait. Examples import this trait through [the prelude]. +/// [`AsyncReadExt`] trait. /// /// [`UnixStream`]: UnixStream /// [`split`]: UnixStream::split() /// [`AsyncReadExt`]: trait@crate::io::AsyncReadExt -/// [the prelude]: crate::prelude #[derive(Debug)] pub struct ReadHalf<'a>(&'a UnixStream); @@ -34,14 +33,13 @@ pub struct ReadHalf<'a>(&'a UnixStream); /// shut down the UnixStream stream in the write direction. /// /// Writing to an `WriteHalf` is usually done using the convenience methods found -/// on the [`AsyncWriteExt`] trait. Examples import this trait through [the prelude]. +/// on the [`AsyncWriteExt`] trait. /// /// [`UnixStream`]: UnixStream /// [`split`]: UnixStream::split() /// [`AsyncWrite`]: trait@crate::io::AsyncWrite /// [`poll_shutdown`]: fn@crate::io::AsyncWrite::poll_shutdown /// [`AsyncWriteExt`]: trait@crate::io::AsyncWriteExt -/// [the prelude]: crate::prelude #[derive(Debug)] pub struct WriteHalf<'a>(&'a UnixStream); diff --git a/tokio/src/net/unix/split_owned.rs b/tokio/src/net/unix/split_owned.rs index 5f0a2593d..f5a93837a 100644 --- a/tokio/src/net/unix/split_owned.rs +++ b/tokio/src/net/unix/split_owned.rs @@ -21,12 +21,11 @@ use std::{fmt, io}; /// Owned read half of a [`UnixStream`], created by [`into_split`]. /// /// Reading from an `OwnedReadHalf` is usually done using the convenience methods found -/// on the [`AsyncReadExt`] trait. Examples import this trait through [the prelude]. +/// on the [`AsyncReadExt`] trait. /// /// [`UnixStream`]: crate::net::UnixStream /// [`into_split`]: crate::net::UnixStream::into_split() /// [`AsyncReadExt`]: trait@crate::io::AsyncReadExt -/// [the prelude]: crate::prelude #[derive(Debug)] pub struct OwnedReadHalf { inner: Arc, @@ -39,15 +38,13 @@ pub struct OwnedReadHalf { /// Dropping the write half will also shut down the write half of the stream. /// /// Writing to an `OwnedWriteHalf` is usually done using the convenience methods -/// found on the [`AsyncWriteExt`] trait. Examples import this trait through -/// [the prelude]. +/// found on the [`AsyncWriteExt`] trait. /// /// [`UnixStream`]: crate::net::UnixStream /// [`into_split`]: crate::net::UnixStream::into_split() /// [`AsyncWrite`]: trait@crate::io::AsyncWrite /// [`poll_shutdown`]: fn@crate::io::AsyncWrite::poll_shutdown /// [`AsyncWriteExt`]: trait@crate::io::AsyncWriteExt -/// [the prelude]: crate::prelude #[derive(Debug)] pub struct OwnedWriteHalf { inner: Arc, diff --git a/tokio/src/prelude.rs b/tokio/src/prelude.rs deleted file mode 100644 index 1909f9da6..000000000 --- a/tokio/src/prelude.rs +++ /dev/null @@ -1,21 +0,0 @@ -#![cfg(not(loom))] - -//! A "prelude" for users of the `tokio` crate. -//! -//! This prelude is similar to the standard library's prelude in that you'll -//! almost always want to import its entire contents, but unlike the standard -//! library's prelude you'll have to do so manually: -//! -//! ``` -//! # #![allow(warnings)] -//! use tokio::prelude::*; -//! ``` -//! -//! The prelude may grow over time as additional items see ubiquitous use. - -pub use crate::io::{self, AsyncBufRead, AsyncRead, AsyncWrite}; - -cfg_io_util! { - #[doc(no_inline)] - pub use crate::io::{AsyncBufReadExt as _, AsyncReadExt as _, AsyncSeekExt as _, AsyncWriteExt as _}; -} diff --git a/tokio/src/runtime/mod.rs b/tokio/src/runtime/mod.rs index d7f068ec1..2c90acb3b 100644 --- a/tokio/src/runtime/mod.rs +++ b/tokio/src/runtime/mod.rs @@ -20,7 +20,7 @@ //! //! ```no_run //! use tokio::net::TcpListener; -//! use tokio::prelude::*; +//! use tokio::io::{AsyncReadExt, AsyncWriteExt}; //! //! #[tokio::main] //! async fn main() -> Result<(), Box> { @@ -63,7 +63,7 @@ //! //! ```no_run //! use tokio::net::TcpListener; -//! use tokio::prelude::*; +//! use tokio::io::{AsyncReadExt, AsyncWriteExt}; //! use tokio::runtime::Runtime; //! //! fn main() -> Result<(), Box> { diff --git a/tokio/src/time/mod.rs b/tokio/src/time/mod.rs index 6f200dccb..8aaf9c18c 100644 --- a/tokio/src/time/mod.rs +++ b/tokio/src/time/mod.rs @@ -36,9 +36,7 @@ //! } //! ``` //! -//! Require that an operation takes no more than 300ms. Note that this uses the -//! `timeout` function on the `FutureExt` trait. This trait is included in the -//! prelude. +//! Require that an operation takes no more than 300ms. //! //! ``` //! use tokio::time::{timeout, Duration}; diff --git a/tokio/tests/buffered.rs b/tokio/tests/buffered.rs index 97ba00cd1..98b6d5f31 100644 --- a/tokio/tests/buffered.rs +++ b/tokio/tests/buffered.rs @@ -2,7 +2,6 @@ #![cfg(feature = "full")] use tokio::net::TcpListener; -use tokio::prelude::*; use tokio_test::assert_ok; use std::io::prelude::*; @@ -41,7 +40,7 @@ async fn echo_server() { let (mut a, _) = assert_ok!(srv.accept().await); let (mut b, _) = assert_ok!(srv.accept().await); - let n = assert_ok!(io::copy(&mut a, &mut b).await); + let n = assert_ok!(tokio::io::copy(&mut a, &mut b).await); let (expected, t2) = t.join().unwrap(); let actual = t2.join().unwrap(); diff --git a/tokio/tests/fs_file.rs b/tokio/tests/fs_file.rs index d5b56e6ee..bf2f1d7b5 100644 --- a/tokio/tests/fs_file.rs +++ b/tokio/tests/fs_file.rs @@ -2,7 +2,7 @@ #![cfg(feature = "full")] use tokio::fs::File; -use tokio::prelude::*; +use tokio::io::{AsyncReadExt, AsyncSeekExt, AsyncWriteExt}; use tokio_test::task; use std::io::prelude::*; diff --git a/tokio/tests/fs_file_mocked.rs b/tokio/tests/fs_file_mocked.rs index edb74a732..77715327d 100644 --- a/tokio/tests/fs_file_mocked.rs +++ b/tokio/tests/fs_file_mocked.rs @@ -62,7 +62,7 @@ pub(crate) mod sync { } use fs::sys; -use tokio::prelude::*; +use tokio::io::{AsyncReadExt, AsyncSeekExt, AsyncWriteExt}; use tokio_test::{assert_pending, assert_ready, assert_ready_err, assert_ready_ok, task}; use std::io::SeekFrom; diff --git a/tokio/tests/process_issue_2174.rs b/tokio/tests/process_issue_2174.rs index 6ee7d1ab5..5ee9dc0a4 100644 --- a/tokio/tests/process_issue_2174.rs +++ b/tokio/tests/process_issue_2174.rs @@ -11,7 +11,7 @@ use std::process::Stdio; use std::time::Duration; -use tokio::prelude::*; +use tokio::io::AsyncWriteExt; use tokio::process::Command; use tokio::time; use tokio_test::assert_err; diff --git a/tokio/tests/rt_common.rs b/tokio/tests/rt_common.rs index d8f57bac9..66e6f2c13 100644 --- a/tokio/tests/rt_common.rs +++ b/tokio/tests/rt_common.rs @@ -56,7 +56,7 @@ fn send_sync_bound() { rt_test! { use tokio::net::{TcpListener, TcpStream, UdpSocket}; - use tokio::prelude::*; + use tokio::io::{AsyncReadExt, AsyncWriteExt}; use tokio::runtime::Runtime; use tokio::sync::oneshot; use tokio::{task, time}; diff --git a/tokio/tests/tcp_connect.rs b/tokio/tests/tcp_connect.rs index 44942c4e9..cbe68fa27 100644 --- a/tokio/tests/tcp_connect.rs +++ b/tokio/tests/tcp_connect.rs @@ -169,7 +169,7 @@ async fn connect_addr_host_str_port_tuple() { #[cfg(target_os = "linux")] mod linux { use tokio::net::{TcpListener, TcpStream}; - use tokio::prelude::*; + use tokio::io::{AsyncReadExt, AsyncWriteExt}; use tokio_test::assert_ok; use mio::unix::UnixReady; diff --git a/tokio/tests/tcp_echo.rs b/tokio/tests/tcp_echo.rs index d9cb456ff..5bb7ff0ac 100644 --- a/tokio/tests/tcp_echo.rs +++ b/tokio/tests/tcp_echo.rs @@ -1,8 +1,8 @@ #![warn(rust_2018_idioms)] #![cfg(feature = "full")] +use tokio::io::{self, AsyncReadExt, AsyncWriteExt}; use tokio::net::{TcpListener, TcpStream}; -use tokio::prelude::*; use tokio::sync::oneshot; use tokio_test::assert_ok; diff --git a/tokio/tests/tcp_shutdown.rs b/tokio/tests/tcp_shutdown.rs index 615855f1b..536a16130 100644 --- a/tokio/tests/tcp_shutdown.rs +++ b/tokio/tests/tcp_shutdown.rs @@ -1,9 +1,8 @@ #![warn(rust_2018_idioms)] #![cfg(feature = "full")] -use tokio::io::{self, AsyncWriteExt}; +use tokio::io::{self, AsyncReadExt, AsyncWriteExt}; use tokio::net::{TcpListener, TcpStream}; -use tokio::prelude::*; use tokio_test::assert_ok; #[tokio::test] @@ -16,7 +15,7 @@ async fn shutdown() { assert_ok!(AsyncWriteExt::shutdown(&mut stream).await); - let mut buf = [0; 1]; + let mut buf = [0u8; 1]; let n = assert_ok!(stream.read(&mut buf).await); assert_eq!(n, 0); }); diff --git a/tokio/tests/uds_split.rs b/tokio/tests/uds_split.rs index 76ff4613c..81614237e 100644 --- a/tokio/tests/uds_split.rs +++ b/tokio/tests/uds_split.rs @@ -2,8 +2,8 @@ #![cfg(feature = "full")] #![cfg(unix)] +use tokio::io::{AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt}; use tokio::net::UnixStream; -use tokio::prelude::*; /// Checks that `UnixStream` can be split into a read half and a write half using /// `UnixStream::split` and `UnixStream::split_mut`.