@ -22,14 +22,14 @@ pin_project! {
/// times. It also provides no advantage when writing to a destination that is
/// times. It also provides no advantage when writing to a destination that is
/// in memory, like a `Vec<u8>`.
/// in memory, like a `Vec<u8>`.
///
///
/// When the `BufWriter` is dropped, the contents of its buffer will be written
/// Unlike the `BufWriter` type in `std`, this type does not write out the
/// out. However, any errors that happen in the process of flushing the buffer
/// contents of its buffer when it is dropped. Therefore, it is absolutely
/// when the writer is dropped will be ignored. Code that wishes to handle such
/// critical that users explicitly flush the buffer before dropping a
/// errors must manually call [`flush`] before the writer is dropped .
/// `BufWriter` .
///
///
/// This type is an async version of [`std::io::Buf Read er`].
/// This type is an async version of [`std::io::Buf Writ er`].
///
///
/// [`std::io::Buf Reader`]: https://doc.rust-lang.org/std/io/struct.BufRead er.html
/// [`std::io::Buf Writer`]: https://doc.rust-lang.org/std/io/struct.BufWrit er.html
///
///
/// # Examples
/// # Examples
///
///
@ -61,10 +61,13 @@ pin_project! {
/// use async_std::prelude::*;
/// use async_std::prelude::*;
///
///
/// let mut stream = BufWriter::new(TcpStream::connect("127.0.0.1:34254").await?);
/// let mut stream = BufWriter::new(TcpStream::connect("127.0.0.1:34254").await?);
///
/// for i in 0..10 {
/// for i in 0..10 {
/// let arr = [i+1];
/// let arr = [i+1];
/// stream.write(&arr).await?;
/// stream.write(&arr).await?;
/// };
/// };
///
/// stream.flush().await?;
/// #
/// #
/// # Ok(()) }) }
/// # Ok(()) }) }
/// ```
/// ```
@ -325,7 +328,7 @@ impl<W: Write> Write for BufWriter<W> {
impl < W : Write + fmt ::Debug > fmt ::Debug for BufWriter < W > {
impl < W : Write + fmt ::Debug > fmt ::Debug for BufWriter < W > {
fn fmt ( & self , f : & mut fmt ::Formatter < ' _ > ) -> fmt ::Result {
fn fmt ( & self , f : & mut fmt ::Formatter < ' _ > ) -> fmt ::Result {
f . debug_struct ( "Buf Read er")
f . debug_struct ( "Buf Writ er")
. field ( "writer" , & self . inner )
. field ( "writer" , & self . inner )
. field ( "buf" , & self . buf )
. field ( "buf" , & self . buf )
. finish ( )
. finish ( )