We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
remove_dir_all
1 parent cb9aa8c commit d5d2785Copy full SHA for d5d2785
library/std/src/fs.rs
@@ -2284,6 +2284,11 @@ pub fn remove_dir<P: AsRef<Path>>(path: P) -> io::Result<()> {
2284
///
2285
/// See [`fs::remove_file`] and [`fs::remove_dir`].
2286
2287
+/// `remove_dir_all` will fail if `remove_dir` or `remove_file` fail on any constituent paths, including the root path.
2288
+/// As a result, the directory you are deleting must exist, meaning that this function is not idempotent.
2289
+///
2290
+/// Consider ignoring the error if validating the removal is not required for your use case.
2291
2292
/// [`fs::remove_file`]: remove_file
2293
/// [`fs::remove_dir`]: remove_dir
2294
0 commit comments