Skip to content

Commit a61b452

Browse files
committed
Merge pull request rust-lang#978 from mzabaluev/clarify-io-into-inner
Amend I/O RFC: clarify the behavior of into_inner
2 parents 3857a25 + 6749ea2 commit a61b452

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

text/0517-io-os-reform.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,10 +1016,11 @@ strings) and is usually what you want when working with iterators.
10161016

10171017
The `BufReader`, `BufWriter` and `BufStream` types stay
10181018
essentially as they are today, except that for streams and writers the
1019-
`into_inner` method yields the structure back in the case of a flush error:
1020-
1019+
`into_inner` method yields the structure back in the case of a write error,
1020+
and its behavior is clarified to writing out the buffered data without
1021+
flushing the underlying reader:
10211022
```rust
1022-
// If flushing fails, you get the unflushed data back
1023+
// If writing fails, you get the unwritten data back
10231024
fn into_inner(self) -> Result<W, IntoInnerError<Self>>;
10241025

10251026
pub struct IntoInnerError<W>(W, Error);

0 commit comments

Comments
 (0)