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

Correct a typo in fs::File::create documentation #106339

Closed
wants to merge 1 commit into from

Conversation

cryptoquick
Copy link

Hi, I think this is a typo, but feel free to close if it isn't.

@rustbot
Copy link
Collaborator

rustbot commented Jan 1, 2023

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @joshtriplett (or someone else) soon.

Please see the contribution instructions for more information.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jan 1, 2023
@rustbot
Copy link
Collaborator

rustbot commented Jan 1, 2023

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@clubby789
Copy link
Contributor

clubby789 commented Jan 1, 2023

The existing link seems correct, as OpenOptions::open details error behaviour, whereas OpenOptions::create does not.

@cryptoquick
Copy link
Author

@clubby789 It's not clear if the sentence I've changed refers to error behavior; I understood it to mean that this method is similar to the corresponding OpenOptions builder method.

@ChrisDenton
Copy link
Member

Hm, I don't think the OpenOptions::create documentation is particularly useful to understanding the File::create method. Here's the current documentation for OpenOptions::create:

Sets the option to create a new file, or open it if it already exists.

In order for the file to be created, OpenOptions::write or OpenOptions::append access must be used.

The documentation for OpenOptions::open does provide more relevant information that isn't available in File::create whereas OpenOptions::create does not.

So I don't think this is a typo. However, maybe it could be mentioned that File::create is a shorthand for OpenOptions::new().write(true).create(true).truncate(true).open(path).

@bors
Copy link
Contributor

bors commented Feb 16, 2023

☔ The latest upstream changes (presumably #108096) made this pull request unmergeable. Please resolve the merge conflicts.

@Dylan-DPC
Copy link
Member

Closing this pr based on the comment

@Dylan-DPC Dylan-DPC closed this Mar 4, 2023
@Dylan-DPC Dylan-DPC removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants