Skip to content

Commit

Permalink
docs(std): clarify remove_dir_all errors
Browse files Browse the repository at this point in the history
  • Loading branch information
philpax committed Apr 27, 2023
1 parent cb9aa8c commit d5d2785
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions library/std/src/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2284,6 +2284,11 @@ pub fn remove_dir<P: AsRef<Path>>(path: P) -> io::Result<()> {
///
/// See [`fs::remove_file`] and [`fs::remove_dir`].
///
/// `remove_dir_all` will fail if `remove_dir` or `remove_file` fail on any constituent paths, including the root path.
/// As a result, the directory you are deleting must exist, meaning that this function is not idempotent.
///
/// Consider ignoring the error if validating the removal is not required for your use case.
///
/// [`fs::remove_file`]: remove_file
/// [`fs::remove_dir`]: remove_dir
///
Expand Down

0 comments on commit d5d2785

Please sign in to comment.