Skip to content

Commit

Permalink
io: flush in AsyncWriteExt examples (#6149)
Browse files Browse the repository at this point in the history
Closes: #6068
  • Loading branch information
Darksonn committed Nov 14, 2023
1 parent 2e5773a commit 06660ef
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tokio/src/io/util/async_write_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
/// }
/// ```
Expand Down Expand Up @@ -162,6 +163,7 @@ cfg_io_util! {
/// ];
///
/// file.write_vectored(&bufs).await?;
/// file.flush().await?;
///
/// Ok(())
/// }
Expand Down Expand Up @@ -244,6 +246,7 @@ cfg_io_util! {
/// // all of it.
/// file.write_buf(&mut buffer).await?;
/// }
/// file.flush().await?;
///
/// Ok(())
/// }
Expand Down Expand Up @@ -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(())
/// }
/// ```
Expand Down Expand Up @@ -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(())
/// }
/// ```
Expand Down

0 comments on commit 06660ef

Please sign in to comment.