From b1d85ab460360e45865101f8389b44d0e4936fc9 Mon Sep 17 00:00:00 2001 From: Yoshua Wuyts Date: Sun, 8 Sep 2019 01:55:39 +0200 Subject: [PATCH 1/2] add io::prelude Signed-off-by: Yoshua Wuyts --- src/io/mod.rs | 2 ++ src/io/prelude.rs | 11 +++++++++++ 2 files changed, 13 insertions(+) create mode 100644 src/io/prelude.rs diff --git a/src/io/mod.rs b/src/io/mod.rs index fd4158782..5152b0347 100644 --- a/src/io/mod.rs +++ b/src/io/mod.rs @@ -20,6 +20,8 @@ //! # Ok(()) }) } //! ``` +pub mod prelude; + #[doc(inline)] pub use std::io::{Error, ErrorKind, Result, SeekFrom}; diff --git a/src/io/prelude.rs b/src/io/prelude.rs new file mode 100644 index 000000000..e7303a9eb --- /dev/null +++ b/src/io/prelude.rs @@ -0,0 +1,11 @@ +//! The I/O Prelude +//! +//! The purpose of this module is to alleviate imports of many common I/O traits +//! by adding a glob import to the top of I/O heavy modules: +//! +//! ``` +//! # #![allow(unused_imports)] +//! use async_std::io::prelude::*; +//! ``` + +pub use super::{BufRead, Read, Seek, Write}; From ec1f33fe622098e4cdbc8bf6ea494aaa41dcb234 Mon Sep 17 00:00:00 2001 From: Yoshua Wuyts Date: Sun, 8 Sep 2019 02:03:09 +0200 Subject: [PATCH 2/2] inline better Signed-off-by: Yoshua Wuyts --- src/io/prelude.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/io/prelude.rs b/src/io/prelude.rs index e7303a9eb..65438e13d 100644 --- a/src/io/prelude.rs +++ b/src/io/prelude.rs @@ -1,4 +1,4 @@ -//! The I/O Prelude +//! The async I/O Prelude //! //! The purpose of this module is to alleviate imports of many common I/O traits //! by adding a glob import to the top of I/O heavy modules: @@ -8,4 +8,11 @@ //! use async_std::io::prelude::*; //! ``` -pub use super::{BufRead, Read, Seek, Write}; +#[doc(no_inline)] +pub use super::BufRead as _; +#[doc(no_inline)] +pub use super::Read as _; +#[doc(no_inline)] +pub use super::Seek as _; +#[doc(no_inline)] +pub use super::Write as _;