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
+1 -1
View File
@@ -936,7 +936,7 @@ pub fn create_new(&mut self, create_new: bool) -> &mut 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