From 1230a08679e70b8d9a9ce653f8663ff27832db54 Mon Sep 17 00:00:00 2001 From: Paul Dicker Date: Thu, 14 Jan 2016 16:59:28 +0100 Subject: Fix doctests --- src/libstd/sys/unix/ext/fs.rs | 5 +++-- src/libstd/sys/windows/ext/fs.rs | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'src/libstd/sys') 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"); /// ``` -- cgit 1.4.1-3-g733a5