diff options
| author | Paul Dicker <pitdicker@gmail.com> | 2016-01-14 16:59:28 +0100 |
|---|---|---|
| committer | Paul Dicker <pitdicker@gmail.com> | 2016-01-14 16:59:28 +0100 |
| commit | 1230a08679e70b8d9a9ce653f8663ff27832db54 (patch) | |
| tree | 20f266b9b3f3b8ced311a6312322db458b264ad1 /src/libstd/sys | |
| parent | 7a1817c9d4a0649a7ea1c948bd731a5b63aa3d06 (diff) | |
| download | rust-1230a08679e70b8d9a9ce653f8663ff27832db54.tar.gz rust-1230a08679e70b8d9a9ce653f8663ff27832db54.zip | |
Fix doctests
Diffstat (limited to 'src/libstd/sys')
| -rw-r--r-- | src/libstd/sys/unix/ext/fs.rs | 5 | ||||
| -rw-r--r-- | src/libstd/sys/windows/ext/fs.rs | 3 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/libstd/sys/unix/ext/fs.rs b/src/libstd/sys/unix/ext/fs.rs index 75ea5846fb3..33f29d44f87 100644 --- a/src/libstd/sys/unix/ext/fs.rs +++ b/src/libstd/sys/unix/ext/fs.rs @@ -114,12 +114,13 @@ pub trait OpenOptionsExt { /// /// # Examples /// - /// ```no_run + /// ```rust,ignore /// extern crate libc; /// use std::fs::OpenOptions; /// use std::os::unix::fs::OpenOptionsExt; /// - /// let options = OpenOptions::new().write(true); + /// let mut options = OpenOptions::new(); + /// options.write(true); /// if cfg!(unix) { options.custom_flags(libc::O_NOFOLLOW); } /// let file = options.open("foo.txt"); /// ``` diff --git a/src/libstd/sys/windows/ext/fs.rs b/src/libstd/sys/windows/ext/fs.rs index 04053b6cb6a..4bb67b0fad9 100644 --- a/src/libstd/sys/windows/ext/fs.rs +++ b/src/libstd/sys/windows/ext/fs.rs @@ -77,7 +77,8 @@ pub trait OpenOptionsExt { /// use std::fs::OpenOptions; /// use std::os::windows::fs::OpenOptionsExt; /// - /// let options = OpenOptions::new().create(true).write(true); + /// let mut options = OpenOptions::new(); + /// options.create(true).write(true); /// if cfg!(windows) { options.custom_flags(winapi::FILE_FLAG_DELETE_ON_CLOSE); } /// let file = options.open("foo.txt"); /// ``` |
