From ad855371cd76fe7b7cb920cd07e8f8b7158230df Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Thu, 11 Jun 2020 08:21:15 +0900 Subject: [PATCH] io: always reexport std::io types that appear in definitions of async io traits --- tokio/src/io/mod.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tokio/src/io/mod.rs b/tokio/src/io/mod.rs index 216213ea979..7c275415404 100644 --- a/tokio/src/io/mod.rs +++ b/tokio/src/io/mod.rs @@ -158,8 +158,8 @@ //! //! # `std` re-exports //! -//! Additionally, [`Error`], [`ErrorKind`], and [`Result`] are re-exported -//! from `std::io` for ease of use. +//! Additionally, [`Error`], [`ErrorKind`], [`Result`], and [`SeekFrom`] are +//! re-exported from `std::io` for ease of use. //! //! [`AsyncRead`]: trait@AsyncRead //! [`AsyncWrite`]: trait@AsyncWrite @@ -172,6 +172,7 @@ //! [`ErrorKind`]: enum@ErrorKind //! [`Result`]: type@Result //! [`Read`]: std::io::Read +//! [`SeekFrom`]: enum@SeekFrom //! [`Sink`]: https://docs.rs/futures/0.3/futures/sink/trait.Sink.html //! [`Stream`]: crate::stream::Stream //! [`Write`]: std::io::Write @@ -183,7 +184,6 @@ mod async_buf_read; pub use self::async_buf_read::AsyncBufRead; mod async_read; - pub use self::async_read::AsyncRead; mod async_seek; @@ -192,6 +192,10 @@ pub use self::async_seek::AsyncSeek; mod async_write; pub use self::async_write::AsyncWrite; +// Re-export some types from `std::io` so that users don't have to deal +// with conflicts when `use`ing `tokio::io` and `std::io`. +pub use std::io::{Error, ErrorKind, Result, SeekFrom}; + cfg_io_driver! { pub(crate) mod driver; @@ -229,10 +233,6 @@ cfg_io_util! { cfg_stream! { pub use util::{stream_reader, StreamReader}; } - - // Re-export io::Error so that users don't have to deal with conflicts when - // `use`ing `tokio::io` and `std::io`. - pub use std::io::{Error, ErrorKind, Result}; } cfg_not_io_util! {