File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -408,24 +408,22 @@ pub trait OpenOptionsExt {
408
408
/// Pass custom flags to the `flags` argument of `open`.
409
409
///
410
410
/// The bits that define the access mode are masked out with `O_ACCMODE`, to
411
- /// ensure they do not interfere with the access mode set by Rusts options.
411
+ /// ensure they do not interfere with the access mode set by Rust's options.
412
412
///
413
- /// Custom flags can only set flags, not remove flags set by Rusts options.
414
- /// This options overwrites any previously set custom flags.
413
+ /// Custom flags can only set flags, not remove flags set by Rust's options.
414
+ /// This function overwrites any previously- set custom flags.
415
415
///
416
416
/// # Examples
417
417
///
418
418
/// ```no_run
419
- /// # #![feature(rustc_private)]
419
+ /// # mod libc { pub const O_NOFOLLOW: i32 = 0; }
420
420
/// use std::fs::OpenOptions;
421
421
/// use std::os::unix::fs::OpenOptionsExt;
422
422
///
423
423
/// # fn main() {
424
424
/// let mut options = OpenOptions::new();
425
425
/// options.write(true);
426
- /// if cfg!(unix) {
427
- /// options.custom_flags(libc::O_NOFOLLOW);
428
- /// }
426
+ /// options.custom_flags(libc::O_NOFOLLOW);
429
427
/// let file = options.open("foo.txt");
430
428
/// # }
431
429
/// ```
You can’t perform that action at this time.
0 commit comments