Skip to content

Commit 6a6623c

Browse files
Merge pull request #869 from jimblandy/buf-writer-doc-fix
Fix BufWriter documentation: BufWriters do not flush when dropped.
2 parents a9580a9 + 949ff90 commit 6a6623c

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)