about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorCorey Farwell <coreyf@rwell.org>2018-01-02 13:30:44 -0800
committerCorey Farwell <coreyf@rwell.org>2018-01-02 13:30:44 -0800
commitf3ef077b910c9dada20eb106e8469ec071c27dad (patch)
treebed3b51ef7bc0a9f26cad67a8f3af07f84961cc7 /src/libstd
parenta37126b90cc9373420e92cebddb4b62d3ded16e1 (diff)
downloadrust-f3ef077b910c9dada20eb106e8469ec071c27dad.tar.gz
rust-f3ef077b910c9dada20eb106e8469ec071c27dad.zip
Document when LineWriter flushes; document errors for into_inner.
Fixes https://github.com/rust-lang/rust/issues/42468.
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/io/buffered.rs11
1 files changed, 11 insertions, 0 deletions
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<W: Write> BufWriter<W> {
     ///
     /// 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<W> fmt::Display for IntoInnerError<W> {
 /// 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<W: Write> LineWriter<W> {
     ///
     /// 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
     ///
     /// ```