Skip to content

Commit 5fa71af

Browse files
committed
add guarantee about remove_dir and remove_file error kinds
approved in ACP rust-lang/libs-team#433
1 parent b1a56b5 commit 5fa71af

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

std/src/fs.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1989,6 +1989,11 @@ impl AsInner<fs_imp::DirEntry> for DirEntry {
19891989
/// * The file doesn't exist.
19901990
/// * The user lacks permissions to remove the file.
19911991
///
1992+
/// This function will only ever return an error of kind `NotFound` if the given
1993+
/// path does not exist. Note that the inverse is not true,
1994+
/// ie. if a path does not exist, its removal may fail for a number of reasons,
1995+
/// such as insufficient permissions.
1996+
///
19921997
/// # Examples
19931998
///
19941999
/// ```no_run
@@ -2446,6 +2451,11 @@ pub fn create_dir_all<P: AsRef<Path>>(path: P) -> io::Result<()> {
24462451
/// * The user lacks permissions to remove the directory at the provided `path`.
24472452
/// * The directory isn't empty.
24482453
///
2454+
/// This function will only ever return an error of kind `NotFound` if the given
2455+
/// path does not exist. Note that the inverse is not true,
2456+
/// ie. if a path does not exist, its removal may fail for a number of reasons,
2457+
/// such as insufficient permissions.
2458+
///
24492459
/// # Examples
24502460
///
24512461
/// ```no_run

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy