Skip to content

Commit 949ff90

Browse files
committed
Fix BufWriter documentation: BufWriters do not flush when dropped.
This was partially fixed in #586, but there's another sentence later that makes the same claim.
1 parent bd29747 commit 949ff90

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: src/io/buf_writer.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ pin_project! {
7474
///
7575
/// By wrapping the stream with a `BufWriter`, these ten writes are all grouped
7676
/// together by the buffer, and will all be written out in one system call when
77-
/// the `stream` is dropped.
77+
/// `stream.flush()` completes. (As mentioned above, dropping a `BufWriter`
78+
/// does not flush its buffers, so a `flush` call is essential.)
7879
///
7980
/// [`Write`]: trait.Write.html
8081
/// [`TcpStream::write`]: ../net/struct.TcpStream.html#method.write

0 commit comments

Comments
 (0)