Rollup merge of #67282 - pjw91:patch-1, r=Dylan-DPC

Fix example code of OpenOptions::open

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

r? @steveklabnik
This commit is contained in:
Mazdak Farrokhzad 2019-12-15 05:57:24 +01:00 committed by GitHub
commit 541dc62d64
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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