From: Patrick Wang Date: Fri, 13 Dec 2019 19:12:50 +0000 (+0800) Subject: Fix incorrect example code of OpenOptions::open X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=b65c6ec10fe2b80e22706f5b3245cc5f6f372edf;hp=3964a55ba59bb6c3d4badcbddc49f6929ef76862;p=rust.git Fix incorrect example code of OpenOptions::open --- diff --git a/src/libstd/fs.rs b/src/libstd/fs.rs index a109e38e1e3..01e57ec0ab9 100644 --- a/src/libstd/fs.rs +++ b/src/libstd/fs.rs @@ -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