Skip to content

Commit 541dc62

Browse files
authored
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
2 parents 39c5d81 + b65c6ec commit 541dc62

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libstd/fs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -936,7 +936,7 @@ impl OpenOptions {
936936
/// ```no_run
937937
/// use std::fs::OpenOptions;
938938
///
939-
/// let file = OpenOptions::new().open("foo.txt");
939+
/// let file = OpenOptions::new().read(true).open("foo.txt");
940940
/// ```
941941
///
942942
/// [`ErrorKind`]: ../io/enum.ErrorKind.html

0 commit comments

Comments
 (0)