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

book: fix mistake (File::open -> File::create) #36374

Merged
merged 2 commits into from
Sep 14, 2016
Merged

book: fix mistake (File::open -> File::create) #36374

merged 2 commits into from
Sep 14, 2016

Conversation

danclive
Copy link
Contributor

No description provided.

@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 @steveklabnik (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.

@bluss bluss changed the title fix mistake (File::open -> File::create) book: fix mistake (File::open -> File::create) Sep 10, 2016
@steveklabnik
Copy link
Member

Thank you! Why is this a mistake, though? And if it is, then the error message needs to change as well.

@danclive
Copy link
Contributor Author

In this example, we are going to open the file and write it in the file. Open is read-only, so it needs to be changed to create to write.

@@ -275,7 +275,7 @@ won’t have its methods:
[write]: ../std/io/trait.Write.html

```rust,ignore
let mut f = std::fs::File::open("foo.txt").expect("Couldn’t open foo.txt");
let mut f = std::fs::File::create("foo.txt").expect("Couldn’t open foo.txt");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think @steveklabnik is suggesting "Couldn’t open foo.txt" should be changed to "Couldn’t create foo.txt"

@danclive
Copy link
Contributor Author

Thank you! @frewsxcv

@steveklabnik
Copy link
Member

@bors: r+ rollup

ah ha! Since it is marked ignore anyways, I didn't notice. Thank you so much!

@bors
Copy link
Contributor

bors commented Sep 13, 2016

📌 Commit 5b59c14 has been approved by steveklabnik

@bors
Copy link
Contributor

bors commented Sep 14, 2016

⌛ Testing commit 5b59c14 with merge 444b90c...

@bors
Copy link
Contributor

bors commented Sep 14, 2016

💔 Test failed - auto-win-gnu-32-opt-rustbuild

@alexcrichton
Copy link
Member

@bors: retry

On Tue, Sep 13, 2016 at 8:39 PM, bors notifications@github.com wrote:

💔 Test failed - auto-win-gnu-32-opt-rustbuild
https://buildbot.rust-lang.org/builders/auto-win-gnu-32-opt-rustbuild/builds/2503


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#36374 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAD95PY9gBuZ9SkM0NawXQjMKLfJ68Esks5qp2yKgaJpZM4J5q7V
.

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Sep 14, 2016
book: fix mistake (File::open -> File::create)
bors added a commit that referenced this pull request Sep 14, 2016
Rollup of 5 pull requests

- Successful merges: #36334, #36335, #36363, #36374, #36467
- Failed merges:
@bors bors merged commit 5b59c14 into rust-lang:master Sep 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants