diff --git a/src/libstd/fs.rs b/src/libstd/fs.rs index a109e38e1e3bc..01e57ec0ab941 100644 --- a/src/libstd/fs.rs +++ b/src/libstd/fs.rs @@ -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