@ -22,14 +22,14 @@ pin_project! {
/// times. It also provides no advantage when writing to a destination that is
/// in memory, like a `Vec<u8>`.
///
/// When the `BufWriter` is dropped, the contents of its buffer will be written
/// out. However, any errors that happen in the process of flushing the buffer
/// when the writer is dropped will be ignored. Code that wishes to handle such
/// errors must manually call [`flush`] before the writer is dropped .
/// Unlike the `BufWriter` type in `std`, this type does not write out the
/// contents of its buffer when it is dropped. Therefore, it is absolutely
/// critical that users explicitly flush the buffer before dropping a
/// `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
///
@ -61,10 +61,13 @@ pin_project! {
/// use async_std::prelude::*;
///
/// let mut stream = BufWriter::new(TcpStream::connect("127.0.0.1:34254").await?);
///
/// for i in 0..10 {
/// let arr = [i+1];
/// stream.write(&arr).await?;
/// };
///
/// stream.flush().await?;
/// #
/// # Ok(()) }) }
/// ```
@ -325,7 +328,7 @@ impl<W: Write> Write for BufWriter<W> {
impl < W : Write + fmt ::Debug > fmt ::Debug for BufWriter < W > {
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 ( "buf" , & self . buf )
. finish ( )