1
Fork 0

Fix doctests

This commit is contained in:
Paul Dicker 2016-01-14 16:59:28 +01:00
parent 7a1817c9d4
commit 1230a08679
3 changed files with 6 additions and 3 deletions

View file

@ -515,6 +515,7 @@ impl OpenOptions {
/// # Examples
///
/// ```no_run
/// #![feature(expand_open_options)]
/// use std::fs::OpenOptions;
///
/// let file = OpenOptions::new().write(true).create_new(true).open("foo.txt");

View file

@ -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");
/// ```

View file

@ -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");
/// ```