diff options
| author | anatawa12 <anatawa12@icloud.com> | 2024-05-06 12:16:31 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-06 12:16:31 +0900 |
| commit | 81f5175868eefa9a12b27377c9fc474d7033cee6 (patch) | |
| tree | 811f75096964cb79db951ec4d68f6012e3598145 /library/std/src | |
| parent | ab066ae329d0f56cfbb551d0c0f4b1121ae30477 (diff) | |
| download | rust-81f5175868eefa9a12b27377c9fc474d7033cee6.tar.gz rust-81f5175868eefa9a12b27377c9fc474d7033cee6.zip | |
Apply suggestions from code review
Co-authored-by: Jubilee <46493976+workingjubilee@users.noreply.github.com>
Diffstat (limited to 'library/std/src')
| -rw-r--r-- | library/std/src/fs.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/library/std/src/fs.rs b/library/std/src/fs.rs index 911bc8cabe2..fb607e05592 100644 --- a/library/std/src/fs.rs +++ b/library/std/src/fs.rs @@ -408,7 +408,9 @@ impl File { /// /// This function will create a file if it does not exist, or return an error if it does. This /// way, if the call succeeds, the file returned is guaranteed to be new. - /// If a file exists at the target location before, creating file will fail with [`AlreadyExists`]. + /// If a file exists at the target location, creating a new file will fail with [`AlreadyExists`] + /// or another error based on the situation. See [`OpenOptions::open`] for a + /// non-exhaustive list of likely errors. /// /// 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 created by another process (a TOCTOU @@ -1074,7 +1076,9 @@ impl OpenOptions { /// /// 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. - /// If a file exists at the target location before, creating file will fail with [`AlreadyExists`]. + /// If a file exists at the target location, creating a new file will fail with [`AlreadyExists`] + /// or another error based on the situation. See [`OpenOptions::open`] for a + /// non-exhaustive list of likely errors. /// /// 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 |
