Merge pull request #633 from k-nasa/fix_io_export

fix missing export for the return value
pull/635/head
Yoshua Wuyts 5 years ago committed by GitHub
commit 37d8a013de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -105,8 +105,8 @@
//! //!
//! ```no_run //! ```no_run
//! use async_std::fs::File; //! use async_std::fs::File;
//! use async_std::io::BufWriter;
//! use async_std::io::prelude::*; //! use async_std::io::prelude::*;
//! use async_std::io::BufWriter;
//! //!
//! # fn main() -> std::io::Result<()> { async_std::task::block_on(async { //! # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
//! # //! #
@ -116,8 +116,8 @@
//! //!
//! // write a byte to the buffer //! // write a byte to the buffer
//! writer.write(&[42]).await?; //! writer.write(&[42]).await?;
//!
//! } // the buffer is flushed once writer goes out of scope //! } // the buffer is flushed once writer goes out of scope
//! //
//! # //! #
//! # Ok(()) }) } //! # Ok(()) }) }
//! ``` //! ```
@ -281,7 +281,7 @@ cfg_std! {
pub use copy::copy; pub use copy::copy;
pub use cursor::Cursor; pub use cursor::Cursor;
pub use empty::{empty, Empty}; pub use empty::{empty, Empty};
pub use read::Read; pub use read::*;
pub use repeat::{repeat, Repeat}; pub use repeat::{repeat, Repeat};
pub use seek::Seek; pub use seek::Seek;
pub use sink::{sink, Sink}; pub use sink::{sink, Sink};

@ -17,6 +17,10 @@ use std::mem;
use crate::io::IoSliceMut; use crate::io::IoSliceMut;
pub use take::Take;
pub use bytes::Bytes;
pub use chain::Chain;
extension_trait! { extension_trait! {
use std::pin::Pin; use std::pin::Pin;
use std::ops::{Deref, DerefMut}; use std::ops::{Deref, DerefMut};
@ -301,11 +305,11 @@ extension_trait! {
# Ok(()) }) } # Ok(()) }) }
``` ```
"#] "#]
fn take(self, limit: u64) -> take::Take<Self> fn take(self, limit: u64) -> Take<Self>
where where
Self: Sized, Self: Sized,
{ {
take::Take { inner: self, limit } Take { inner: self, limit }
} }
#[doc = r#" #[doc = r#"
@ -377,8 +381,8 @@ extension_trait! {
# Ok(()) }) } # Ok(()) }) }
``` ```
"#] "#]
fn bytes(self) -> bytes::Bytes<Self> where Self: Sized { fn bytes(self) -> Bytes<Self> where Self: Sized {
bytes::Bytes { inner: self } Bytes { inner: self }
} }
#[doc = r#" #[doc = r#"
@ -413,8 +417,8 @@ extension_trait! {
# Ok(()) }) } # Ok(()) }) }
``` ```
"#] "#]
fn chain<R: Read>(self, next: R) -> chain::Chain<Self, R> where Self: Sized { fn chain<R: Read>(self, next: R) -> Chain<Self, R> where Self: Sized {
chain::Chain { first: self, second: next, done_first: false } Chain { first: self, second: next, done_first: false }
} }
} }

Loading…
Cancel
Save