-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Add links to std::char::REPLACEMENT_CHARACTER from docs. #53273
Conversation
r? @sfackler (rust_highfive has picked a reviewer for you, use r? to override) |
r? @rust-lang/docs |
/// CHARACTER` and return a [`Cow`]`::`[`Owned`]`(`[`String`]`)` | ||
/// with the result. | ||
/// replace any invalid UTF-8 sequences with | ||
/// [`U+FFFD REPLACEMENT CHARACTER`][U+FFFD] and return a |
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.
Looks like we're a bit inconsistent between "U+FFFD REPLACEMENT CHARACTER
" and "U+FFFD REPLACEMENT CHARACTER".
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.
What's your opinion? I don't feel strongly
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.
I don't really feel strongly either.
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.
Made consistent in the latest force push
There are a few places where we mention the replacement character in the docs, and it could be helpful for users to utilize the constant which is available in the standard library, so let’s link to it!
b596f21
to
ec18991
Compare
@@ -621,14 +622,15 @@ impl String { | |||
} | |||
|
|||
/// Decode a UTF-16 encoded slice `v` into a `String`, replacing | |||
/// invalid data with the replacement character (U+FFFD). | |||
/// invalid data with [the replacement character (`U+FFFD`)][U+FFFD]. |
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.
was this missed in the push to U+FFFD REPLACEMENT CHARACTER
everywhere (the above comment)?
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.
Not missed, I intentionally didn't change this instance. Not sure I see the value in making all of these cases exactly identical
Thanks! @bors: r+ rollup |
📌 Commit ec18991 has been approved by |
🌲 The tree is currently closed for pull requests below priority 10, this pull request will be tested once the tree is reopened |
…eGomez Add links to std::char::REPLACEMENT_CHARACTER from docs. There are a few places where we mention the replacement character in the docs, and it could be helpful for users to utilize the constant which is available in the standard library, so let’s link to it!
…eGomez Add links to std::char::REPLACEMENT_CHARACTER from docs. There are a few places where we mention the replacement character in the docs, and it could be helpful for users to utilize the constant which is available in the standard library, so let’s link to it!
Rollup of 15 pull requests Successful merges: - #52955 (Update compiler test documentation) - #53019 (Don't collect() when size_hint is useless) - #53025 (Consider changing assert! to debug_assert! when it calls visit_with) - #53059 (Remove explicit returns where unnecessary) - #53165 ( Add aarch64-unknown-netbsd target) - #53210 (Deny future duplication of rustc-ap-syntax) - #53223 (A few cleanups for rustc_data_structures) - #53230 ([nll] enable feature(nll) on various crates for bootstrap: part 4) - #53231 (Add let keyword doc) - #53240 (Add individual documentation for <integer>`.swap_bytes`/.`reverse_bits`) - #53253 (Remove unwanted console log) - #53264 (Show that Command can be reused and remodified) - #53267 (Fix styles) - #53273 (Add links to std::char::REPLACEMENT_CHARACTER from docs.) - #53283 (wherein we suggest float for integer literals where a float was expected) Failed merges: r? @ghost
There are a few places where we mention the replacement character in the
docs, and it could be helpful for users to utilize the constant which is
available in the standard library, so let’s link to it!