Skip to content

Commit

Permalink
Rollup merge of #67282 - pjw91:patch-1, r=Dylan-DPC
Browse files Browse the repository at this point in the history
Fix example code of OpenOptions::open

The example didn't set the access mode flag, which resulted in an `Err(InvalidInput)`.

r? @steveklabnik
  • Loading branch information
Centril committed Dec 13, 2019
2 parents 319dc61 + b65c6ec commit 6df8ddc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libstd/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,7 @@ impl OpenOptions {
/// ```no_run
/// use std::fs::OpenOptions;
///
/// let file = OpenOptions::new().open("foo.txt");
/// let file = OpenOptions::new().read(true).open("foo.txt");
/// ```
///
/// [`ErrorKind`]: ../io/enum.ErrorKind.html
Expand Down

0 comments on commit 6df8ddc

Please sign in to comment.