mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-30 14:52:56 +03:00
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:
+1
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user