about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorjumbatm <jumbatm@gmail.com>2020-02-19 19:57:32 +1000
committerjumbatm <jumbatm@gmail.com>2020-02-19 19:57:32 +1000
commitc899dc14011a67b127bf59622cb13b7ff4a11e9a (patch)
tree0cf252bc38c04ecf59828a77c38a3c31b58e7bf8 /src
parent3a8108d8e52e13f3f1a151a93addfcf4a86b97f5 (diff)
downloadrust-c899dc14011a67b127bf59622cb13b7ff4a11e9a.tar.gz
rust-c899dc14011a67b127bf59622cb13b7ff4a11e9a.zip
Reword OpenOptions::{create, create_new} doc.
Diffstat (limited to 'src')
-rw-r--r--src/libstd/fs.rs12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/libstd/fs.rs b/src/libstd/fs.rs
index cff7bbe5ef1..09be3f13050 100644
--- a/src/libstd/fs.rs
+++ b/src/libstd/fs.rs
@@ -844,10 +844,7 @@ impl OpenOptions {
         self
     }
 
-    /// Sets the option for creating a new file.
-    ///
-    /// This option indicates whether a new file will be created if the file
-    /// does not yet already exist.
+    /// Sets the option to create a new file, or open it if it already exists.
     ///
     /// In order for the file to be created, [`write`] or [`append`] access must
     /// be used.
@@ -868,11 +865,10 @@ impl OpenOptions {
         self
     }
 
-    /// Sets the option to always create a new file.
+    /// Sets the option to create a new file, failing if it already exists.
     ///
-    /// This option indicates whether a new file will be created.
-    /// No file is allowed to exist at the target location, also no (dangling)
-    /// symlink.
+    /// No file is allowed to exist at the target location, also no (dangling) symlink. In this
+    /// way, if the call succeeds, the file returned is guaranteed to be new.
     ///
     /// This option is useful because it is atomic. Otherwise between checking
     /// whether a file exists and creating a new one, the file may have been