]> git.lizzy.rs Git - rust.git/commitdiff
Fix incorrect example code of OpenOptions::open
authorPatrick Wang <mail6543210@yahoo.com.tw>
Fri, 13 Dec 2019 19:12:50 +0000 (03:12 +0800)
committerGitHub <noreply@github.com>
Fri, 13 Dec 2019 19:12:50 +0000 (03:12 +0800)
src/libstd/fs.rs

index a109e38e1e3bc7e21774d9851e28c759f61ff3d8..01e57ec0ab9415600e0023688fc40e971bf55431 100644 (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