You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The original example didn't check the return value of `write()`, didn't
flush the writer, and didn't properly demonstrate the buffering.
Fixesrust-lang#51621.
kennytm
added a commit
to kennytm/rust
that referenced
this issue
Jul 18, 2018
use checked write in `LineWriter` example
The example was wrong because it didn't check the return value of
`write()`, and it didn't flush the buffer before comparing the contents
of the file.
Fixesrust-lang#51621.
In the example for LineWriter there is this code fragment:
This code isn't correct -- it should be
file.write_all
instead. In fact, trying the run the example fails onplay.rust-lang.org
.The text was updated successfully, but these errors were encountered: