Skip to content

Commit

Permalink
Rollup merge of rust-lang#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 authored Dec 14, 2019
2 parents 18cbf24 + b65c6ec commit 389aa5f
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 389aa5f

Please sign in to comment.