diff --git a/tokio/src/io/util/async_write_ext.rs b/tokio/src/io/util/async_write_ext.rs index a9812d57e8d..2760e912930 100644 --- a/tokio/src/io/util/async_write_ext.rs +++ b/tokio/src/io/util/async_write_ext.rs @@ -117,6 +117,7 @@ cfg_io_util! { /// /// // Writes some prefix of the byte string, not necessarily all of it. /// file.write(b"some bytes").await?; + /// file.flush().await?; /// Ok(()) /// } /// ``` @@ -162,6 +163,7 @@ cfg_io_util! { /// ]; /// /// file.write_vectored(&bufs).await?; + /// file.flush().await?; /// /// Ok(()) /// } @@ -244,6 +246,7 @@ cfg_io_util! { /// // all of it. /// file.write_buf(&mut buffer).await?; /// } + /// file.flush().await?; /// /// Ok(()) /// } @@ -307,6 +310,7 @@ cfg_io_util! { /// let mut buffer = Cursor::new(b"data to write"); /// /// file.write_all_buf(&mut buffer).await?; + /// file.flush().await?; /// Ok(()) /// } /// ``` @@ -356,6 +360,7 @@ cfg_io_util! { /// let mut file = File::create("foo.txt").await?; /// /// file.write_all(b"some bytes").await?; + /// file.flush().await?; /// Ok(()) /// } /// ```