From 321b680fe66d1be04cd67fac75ff7f148fd117fe Mon Sep 17 00:00:00 2001 From: Federico Ponzi Date: Wed, 2 Sep 2020 10:48:11 +0200 Subject: Update docs of OpenOptions::as_flags --- library/std/src/sys/unix/ext/fs.rs | 5 ++--- library/std/src/sys/unix/fs.rs | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'library/std/src') diff --git a/library/std/src/sys/unix/ext/fs.rs b/library/std/src/sys/unix/ext/fs.rs index afda21d00e0..16fe316110d 100644 --- a/library/std/src/sys/unix/ext/fs.rs +++ b/library/std/src/sys/unix/ext/fs.rs @@ -346,10 +346,9 @@ pub trait OpenOptionsExt { #[stable(feature = "open_options_ext", since = "1.10.0")] fn custom_flags(&mut self, flags: i32) -> &mut Self; - /// Get the flags of this OpenOptions as [`libc::c_int`]. - /// With: [`libc::open`] + /// Get the flags as [`libc::c_int`]. /// - /// This method allows the reuse of the OpenOptions as flags argument for [`fs::OpenOptions`]. + /// This method allows the reuse of the OpenOptions as flags argument for [`libc::open`]. /// /// [`libc::c_int`]: https://docs.rs/libc/*/libc/type.c_int.html /// [`libc::open`]: https://docs.rs/libc/*/libc/fn.open.html diff --git a/library/std/src/sys/unix/fs.rs b/library/std/src/sys/unix/fs.rs index 1281fcc47bc..6f1db6503f1 100644 --- a/library/std/src/sys/unix/fs.rs +++ b/library/std/src/sys/unix/fs.rs @@ -655,6 +655,7 @@ impl OpenOptions { pub fn mode(&mut self, mode: u32) { self.mode = mode as mode_t; } + pub fn as_flags(&self) -> io::Result { let access_mode = self.get_access_mode()?; let creation_mode = self.get_creation_mode()?; -- cgit 1.4.1-3-g733a5