From f3ef077b910c9dada20eb106e8469ec071c27dad Mon Sep 17 00:00:00 2001 From: Corey Farwell Date: Tue, 2 Jan 2018 13:30:44 -0800 Subject: [PATCH] Document when LineWriter flushes; document errors for into_inner. Fixes https://github.com/rust-lang/rust/issues/42468. --- src/libstd/io/buffered.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/libstd/io/buffered.rs b/src/libstd/io/buffered.rs index 8308ab48d9c..7001d8e0421 100644 --- a/src/libstd/io/buffered.rs +++ b/src/libstd/io/buffered.rs @@ -486,6 +486,10 @@ impl BufWriter { /// /// The buffer is written out before returning the writer. /// + /// # Errors + /// + /// An `Err` will be returned if an error occurs while flushing the buffer. + /// /// # Examples /// /// ```no_run @@ -650,6 +654,9 @@ impl fmt::Display for IntoInnerError { /// completed, rather than the entire buffer at once. Enter `LineWriter`. It /// does exactly that. /// +/// Like [`BufWriter`], a `LineWriter`’s buffer will also be flushed when the +/// `LineWriter` goes out of scope or when its internal buffer is full. +/// /// [bufwriter]: struct.BufWriter.html /// /// If there's still a partial line in the buffer when the `LineWriter` is @@ -785,6 +792,10 @@ impl LineWriter { /// /// The internal buffer is written out before returning the writer. /// + // # Errors + /// + /// An `Err` will be returned if an error occurs while flushing the buffer. + /// /// # Examples /// /// ```