Uh oh!
There was an error while loading. Please reload this page.
Replace File::create and write_all with fs::write - #82174
Merged
Conversation
rust-highfive
commented
Feb 16, 2021
Contributor
r? @oli-obk (rust-highfive has picked a reviewer for you, use r? to override) |
bjorn3
reviewed
Feb 16, 2021
Uh oh!
There was an error while loading. Please reload this page.
bjorn3
reviewed
Feb 16, 2021
Uh oh!
There was an error while loading. Please reload this page.
Also don't convert to u8 buffers and back when we are only creating strings.
| .unwrap(); | ||
| write_output(out, ofile); | ||
| let out = std::str::from_utf8(&out).unwrap(); |
Contributor
There was a problem hiding this comment.
Can we just unwrap? Does this never fails? If that's they case why not just from_utf8_unchecked?
Member
There was a problem hiding this comment.
It should never fail, but a future change may make it fail, in which case it is better to panic than to have silent UB.
oli-obk
commented
Feb 17, 2021
Contributor
@bors r+ rollup |
bors
commented
Feb 17, 2021
Collaborator
📌 Commit e527def has been approved by |
bors added a commit
to rust-lang-ci/rust
that referenced
this pull request
Feb 17, 2021
…laumeGomez Rollup of 11 pull requests Successful merges: - rust-lang#79981 (Add 'consider using' message to overflowing_literals) - rust-lang#82094 (To digit simplification) - rust-lang#82105 (Don't fail to remove files if they are missing) - rust-lang#82136 (Fix ICE: Use delay_span_bug for mismatched subst/hir arg) - rust-lang#82169 (Document that `assert!` format arguments are evaluated lazily) - rust-lang#82174 (Replace File::create and write_all with fs::write) - rust-lang#82196 (Add caveat to Path::display() about lossiness) - rust-lang#82198 (Use internal iteration in Iterator::is_sorted_by) - rust-lang#82204 (Update books) - rust-lang#82207 (rustdoc: treat edition 2021 as unstable) - rust-lang#82231 (Add long explanation for E0543) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Also don't convert to u8 buffers and back
when we are only creating strings.