-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Add a write_char
method to std::fmt::Write
#24661
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
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (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. 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 CONTRIBUTING.md for more information. |
I'm fine with this coming in as That said, I don't think we'll cherry-pick this for 1.0, so can you please put |
Done. Is it still |
@bors: r+ |
📌 Commit 16181e6 has been approved by |
as accepted in [RFC 526](https://github.com/rust-lang/rfcs/blob/master/text/0526-fmt-text-writer.md). Note that this brand new method is marked as **stable**. I judged this safe enough: it’s simple enough that it’s very unlikely to change. Still, I can mark it unstable instead if you prefer. r? @alexcrichton
No tests? :( |
I am kind of out of the loop, here. Is Rust perpetuating C's confusion of octets with characters? Or does write_char write out enough octets to form a code point (which we can, informally, call a character because it's close enough for most purposes)? If it just writes a byte, that seems like a worthy goal, but then the name is wrong. |
@ncm: I don’t think there is such a confusion. A My goal here is to use this trait not just for formatting, but as a general-purpose Unicode-based stream. The default implementation of |
This is the logical next step after rust-lang#24661, but I’m less sure about this one.
…ichton … added in rust-lang#24661.
This is the logical next step after rust-lang#24661, but I’m less sure about this one.
This is the logical next step after #24661, but I’m less sure about this one. r? @alexcrichton
as accepted in RFC 526.
Note that this brand new method is marked as stable. I judged this safe enough: it’s simple enough that it’s very unlikely to change. Still, I can mark it unstable instead if you prefer.
r? @alexcrichton