-
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
Fix docs for OsStr #47357
Fix docs for OsStr #47357
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Mark-Simulacrum (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/libstd/ffi/os_str.rs
Outdated
@@ -84,13 +84,15 @@ pub struct OsString { | |||
/// This type represents a borrowed reference to a string in the operating system's preferred | |||
/// representation. | |||
/// | |||
/// `OsStr` is to [`OsString`] as [`String`] is to [`&str`]: the former in each pair are borrowed | |||
/// `OsStr` is to [`OsString`] as [`&str`] is to [`String`]: the former in each pair are borrowed |
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 should either be &OsStr
and &str
or OsStr
and str
All good except @Diggsey's comment. Please fix it and then r=me. |
Thanks! @bors: r+ rollup |
📌 Commit 8002876 has been approved by |
…omez Fix docs for OsStr At present, there are two small issues with the [docs](https://doc.rust-lang.org/std/ffi/struct.OsStr.html) for std::ffi::OsStr: - The docs say "OsStr is to OsString as String is to &str: the former in each pair are borrowed references; the latter are owned strings.". The latter pair is mixed up: String is the owned variant whereas &str is the borrowed reference. - The doc links to String and &str are broken and render as [String] and [&str]. This PR fixes these issues.
At present, there are two small issues with the docs for std::ffi::OsStr:
This PR fixes these issues.