Skip to content

Commit 272bdfd

Browse files
committed
std::fs: slightly reformat remove_dir_all error docs
To make the error cases easier to spot on a quick glance.
1 parent b7b8146 commit 272bdfd

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

std/src/fs.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -2841,9 +2841,11 @@ pub fn remove_dir<P: AsRef<Path>>(path: P) -> io::Result<()> {
28412841
///
28422842
/// See [`fs::remove_file`] and [`fs::remove_dir`].
28432843
///
2844-
/// `remove_dir_all` will fail if `remove_dir` or `remove_file` fail on any constituent paths, including the root `path`.
2845-
/// As a result, the directory you are deleting must exist, meaning that this function is not idempotent.
2846-
/// Additionally, `remove_dir_all` will also fail if the `path` is not a directory.
2844+
/// [`remove_dir_all`] will fail if [`remove_dir`] or [`remove_file`] fail on *any* constituent
2845+
/// paths, *including* the root `path`. Consequently,
2846+
///
2847+
/// - The directory you are deleting *must* exist, meaning that this function is *not idempotent*.
2848+
/// - [`remove_dir_all`] will fail if the `path` is *not* a directory.
28472849
///
28482850
/// Consider ignoring the error if validating the removal is not required for your use case.
28492851
///

0 commit comments

Comments
 (0)