-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Issue #39688 - Help people find String::as_bytes() for UTF-8 #40226
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @brson (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. |
src/libcollections/string.rs
Outdated
@@ -1913,7 +1917,7 @@ impl<T: fmt::Display + ?Sized> ToString for T { | |||
use core::fmt::Write; | |||
let mut buf = String::new(); | |||
buf.write_fmt(format_args!("{}", self)) | |||
.expect("a Display implementation return an error unexpectedly"); | |||
.expect("a Display implementation return an error unexpectedly"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this change is unrelated, but it's also good; you should probably remove it since it has nothing to do with this issue.
This looks great @jdhorwitz ! Two things:
Thanks! And as before, if you need help with any of this, just ping me on IRC 😄 |
81dd468
to
f7b7c1e
Compare
@bors: r+ rollup thank you! |
📌 Commit f7b7c1e has been approved by |
Issue rust-lang#39688 - Help people find String::as_bytes() for UTF-8 Added in links for the inverse functions so people will know that as_bytes() is the inverse of from_utf8() and vice versa. ?r @steveklabnik
🔒 Merge conflict |
f1ef44f
to
3cc94c3
Compare
@bors: r+ rollup |
📌 Commit 3cc94c3 has been approved by |
Issue #39688 - Help people find String::as_bytes() for UTF-8 Added in links for the inverse functions so people will know that as_bytes() is the inverse of from_utf8() and vice versa. ?r @steveklabnik
💔 Test failed - status-travis |
@bors: retry |
Issue #39688 - Help people find String::as_bytes() for UTF-8 Added in links for the inverse functions so people will know that as_bytes() is the inverse of from_utf8() and vice versa. ?r @steveklabnik
💔 Test failed - status-travis |
@bors: r- |
src/libcollections/string.rs
Outdated
@@ -433,6 +433,8 @@ impl String { | |||
/// | |||
/// [`str::from_utf8()`]: ../../std/str/fn.from_utf8.html | |||
/// | |||
/// The inverse of this method is [`as_bytes`](#method.as_bytes). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't use this link syntax. Move the url below and just keep [as_bytes]
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yeah, good call!
src/libcollections/string.rs
Outdated
@@ -979,6 +981,8 @@ impl String { | |||
|
|||
/// Returns a byte slice of this `String`'s contents. | |||
/// | |||
/// The inverse of this method is [`from_utf8`](#method.from_utf8). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment.
Changes pushed @GuillaumeGomez , thank you for your feedback! |
@bors r+ rollup |
⌛ Testing commit 86bad49 with merge 010c716... |
💔 Test failed - status-travis |
… On Sun, Mar 5, 2017 at 9:42 PM, bors ***@***.***> wrote:
💔 Test failed - status-travis
<https://travis-ci.org/rust-lang/rust/builds/208053034>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#40226 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AABsitKFTs2yhgVzFtG08ZgxyZMhXr_Eks5ri3J_gaJpZM4MR6PC>
.
|
⌛ Testing commit 86bad49 with merge c05a044... |
💔 Test failed - status-travis |
@bors: retry
|
Issue rust-lang#39688 - Help people find String::as_bytes() for UTF-8 Added in links for the inverse functions so people will know that as_bytes() is the inverse of from_utf8() and vice versa. ?r @steveklabnik
Issue rust-lang#39688 - Help people find String::as_bytes() for UTF-8 Added in links for the inverse functions so people will know that as_bytes() is the inverse of from_utf8() and vice versa. ?r @steveklabnik
Issue rust-lang#39688 - Help people find String::as_bytes() for UTF-8 Added in links for the inverse functions so people will know that as_bytes() is the inverse of from_utf8() and vice versa. ?r @steveklabnik
Issue rust-lang#39688 - Help people find String::as_bytes() for UTF-8 Added in links for the inverse functions so people will know that as_bytes() is the inverse of from_utf8() and vice versa. ?r @steveklabnik
Issue rust-lang#39688 - Help people find String::as_bytes() for UTF-8 Added in links for the inverse functions so people will know that as_bytes() is the inverse of from_utf8() and vice versa. ?r @steveklabnik
Added in links for the inverse functions so people will know that as_bytes() is the inverse of from_utf8() and vice versa.
?r @steveklabnik