File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -515,6 +515,7 @@ impl OpenOptions {
515515 /// # Examples
516516 ///
517517 /// ```no_run
518+ /// #![feature(expand_open_options)]
518519 /// use std::fs::OpenOptions;
519520 ///
520521 /// let file = OpenOptions::new().write(true).create_new(true).open("foo.txt");
Original file line number Diff line number Diff line change @@ -114,12 +114,13 @@ pub trait OpenOptionsExt {
114114 ///
115115 /// # Examples
116116 ///
117- /// ```no_run
117+ /// ```rust,ignore
118118 /// extern crate libc;
119119 /// use std::fs::OpenOptions;
120120 /// use std::os::unix::fs::OpenOptionsExt;
121121 ///
122- /// let options = OpenOptions::new().write(true);
122+ /// let mut options = OpenOptions::new();
123+ /// options.write(true);
123124 /// if cfg!(unix) { options.custom_flags(libc::O_NOFOLLOW); }
124125 /// let file = options.open("foo.txt");
125126 /// ```
Original file line number Diff line number Diff line change @@ -77,7 +77,8 @@ pub trait OpenOptionsExt {
7777 /// use std::fs::OpenOptions;
7878 /// use std::os::windows::fs::OpenOptionsExt;
7979 ///
80- /// let options = OpenOptions::new().create(true).write(true);
80+ /// let mut options = OpenOptions::new();
81+ /// options.create(true).write(true);
8182 /// if cfg!(windows) { options.custom_flags(winapi::FILE_FLAG_DELETE_ON_CLOSE); }
8283 /// let file = options.open("foo.txt");
8384 /// ```
You can’t perform that action at this time.
0 commit comments