Skip to content
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

Merged
merged 3 commits into from
Jan 12, 2018
Merged

Fix docs for OsStr #47357

merged 3 commits into from
Jan 12, 2018

Conversation

whentze
Copy link
Contributor

@whentze whentze commented Jan 11, 2018

At present, there are two small issues with the docs 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.

@rust-highfive
Copy link
Collaborator

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.

@Mark-Simulacrum
Copy link
Member

r? @GuillaumeGomez

@kennytm kennytm added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 11, 2018
@@ -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
Copy link
Contributor

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

@GuillaumeGomez
Copy link
Member

All good except @Diggsey's comment. Please fix it and then r=me.

@whentze
Copy link
Contributor Author

whentze commented Jan 11, 2018

r? @GuillaumeGomez

@GuillaumeGomez
Copy link
Member

Thanks!

@bors: r+ rollup

@bors
Copy link
Contributor

bors commented Jan 12, 2018

📌 Commit 8002876 has been approved by GuillaumeGomez

kennytm added a commit to kennytm/rust that referenced this pull request Jan 12, 2018
…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.
bors added a commit that referenced this pull request Jan 12, 2018
@bors bors merged commit 8002876 into rust-lang:master Jan 12, 2018
@whentze whentze deleted the osstr-doc-fix branch January 13, 2018 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants