-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update BufWriter example to include call to flush() #63410
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @joshtriplett (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
@bors rollup |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
There's a similar issue with Rust's handling of close(2). As per the Linux man page:
|
By all means, we should check for errors in |
Nobody suggested that, I'm just saying this is still misleading:
People shouldn't have the wrong idea about what |
@Freaky @joshtriplett I updated the wording based on your comments, but frankly I'm a little out of my element here. I'm more familiar with Windows I/O - which has its own set of idiosyncrasies 🤣 Bottom line, feel free to propose verbiage. |
Ping from triage, any updates? @joshtriplett |
second ping from triage, nominating another reviewer. @Centril could you review this? Thanks |
Sorry for the delayed response; had a busy week. This looks reasonable to me. One nit: please fold the commit removing trailing whitespace into the commit that added that whitespace. With that change, r=me. |
Thanks, @joshtriplett - I rebased off master, squashing those two commits. |
@bors r+ |
📌 Commit 1b94610 has been approved by |
Update BufWriter example to include call to flush() I was playing with a writing a Huffman encoder/decoder and was getting weird corruptions and truncations. I finally realized it was was because `BufWriter` was swallowing write errors 😬. I've found Rust to generally be explicit and err on the safe side, so I definitely found this unintuitive and not "rustic". https://twitter.com/johnterickson/status/1159514988123312128
Update BufWriter example to include call to flush() I was playing with a writing a Huffman encoder/decoder and was getting weird corruptions and truncations. I finally realized it was was because `BufWriter` was swallowing write errors 😬. I've found Rust to generally be explicit and err on the safe side, so I definitely found this unintuitive and not "rustic". https://twitter.com/johnterickson/status/1159514988123312128
Rollup of 5 pull requests Successful merges: - #63410 (Update BufWriter example to include call to flush()) - #64029 (Account for rounding errors when deciding the diagnostic boundaries) - #64032 (rustdoc use -Ccodegen-units=1 by default for test compile) - #64039 (Update sync condvar doc style) - #64042 (Fix word repetition in str documentation) Failed merges: r? @ghost
I was playing with a writing a Huffman encoder/decoder and was getting weird corruptions and truncations. I finally realized it was was because
BufWriter
was swallowing write errors 😬. I've found Rust to generally be explicit and err on the safe side, so I definitely found this unintuitive and not "rustic".https://twitter.com/johnterickson/status/1159514988123312128