]> git.lizzy.rs Git - rust.git/commitdiff
Document when LineWriter flushes; document errors for into_inner.
authorCorey Farwell <coreyf@rwell.org>
Tue, 2 Jan 2018 21:30:44 +0000 (13:30 -0800)
committerCorey Farwell <coreyf@rwell.org>
Tue, 2 Jan 2018 21:30:44 +0000 (13:30 -0800)
Fixes https://github.com/rust-lang/rust/issues/42468.

src/libstd/io/buffered.rs

index 8308ab48d9ceb47ce3e6081b2c85da931d8245b6..7001d8e042196c46ac8348b8cd0b50746c06c1f6 100644 (file)
@@ -486,6 +486,10 @@ pub fn get_mut(&mut self) -> &mut W { self.inner.as_mut().unwrap() }
     ///
     /// 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 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 /// 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 @@ pub fn get_mut(&mut self) -> &mut W { self.inner.get_mut() }
     ///
     /// 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
     ///
     /// ```