Skip to content

Commit b416119

Browse files
authored
Rollup merge of rust-lang#47145 - frewsxcv:frewsxcv-linewriter-error, r=QuietMisdreavus
Document when LineWriter flushes; document errors for into_inner. Fixes rust-lang#42468.
2 parents 08501bd + f3ef077 commit b416119

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Diff for: src/libstd/io/buffered.rs

+11
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,10 @@ impl<W: Write> BufWriter<W> {
486486
///
487487
/// The buffer is written out before returning the writer.
488488
///
489+
/// # Errors
490+
///
491+
/// An `Err` will be returned if an error occurs while flushing the buffer.
492+
///
489493
/// # Examples
490494
///
491495
/// ```no_run
@@ -650,6 +654,9 @@ impl<W> fmt::Display for IntoInnerError<W> {
650654
/// completed, rather than the entire buffer at once. Enter `LineWriter`. It
651655
/// does exactly that.
652656
///
657+
/// Like [`BufWriter`], a `LineWriter`’s buffer will also be flushed when the
658+
/// `LineWriter` goes out of scope or when its internal buffer is full.
659+
///
653660
/// [bufwriter]: struct.BufWriter.html
654661
///
655662
/// If there's still a partial line in the buffer when the `LineWriter` is
@@ -785,6 +792,10 @@ impl<W: Write> LineWriter<W> {
785792
///
786793
/// The internal buffer is written out before returning the writer.
787794
///
795+
// # Errors
796+
///
797+
/// An `Err` will be returned if an error occurs while flushing the buffer.
798+
///
788799
/// # Examples
789800
///
790801
/// ```

0 commit comments

Comments
 (0)