std::fs: slightly reformat remove_dir_all error docs
To make the error cases easier to spot on a quick glance.
This commit is contained in:
parent
3b022d8cee
commit
477a2eeb3d
1 changed files with 5 additions and 3 deletions
|
|
@ -2841,9 +2841,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.
|
||||
/// Additionally, `remove_dir_all` will also fail if the `path` is not a directory.
|
||||
/// [`remove_dir_all`] will fail if [`remove_dir`] or [`remove_file`] fail on *any* constituent
|
||||
/// paths, *including* the root `path`. Consequently,
|
||||
///
|
||||
/// - The directory you are deleting *must* exist, meaning that this function is *not idempotent*.
|
||||
/// - [`remove_dir_all`] will fail if the `path` is *not* a directory.
|
||||
///
|
||||
/// Consider ignoring the error if validating the removal is not required for your use case.
|
||||
///
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue