From 949ff90306d52cb4089af202bd0bdbc6165647d1 Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Sun, 30 Aug 2020 12:20:00 -0700 Subject: [PATCH] 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. --- src/io/buf_writer.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/io/buf_writer.rs b/src/io/buf_writer.rs index c527d027..c972937f 100644 --- a/src/io/buf_writer.rs +++ b/src/io/buf_writer.rs @@ -74,7 +74,8 @@ pin_project! { /// /// By wrapping the stream with a `BufWriter`, these ten writes are all grouped /// together by the buffer, and will all be written out in one system call when - /// the `stream` is dropped. + /// `stream.flush()` completes. (As mentioned above, dropping a `BufWriter` + /// does not flush its buffers, so a `flush` call is essential.) /// /// [`Write`]: trait.Write.html /// [`TcpStream::write`]: ../net/struct.TcpStream.html#method.write