about summary refs log tree commit diff
diff options
context:
space:
mode:
author许杰友 Jieyou Xu (Joe) <39484203+jieyouxu@users.noreply.github.com>2025-02-19 02:00:02 +0800
committer许杰友 Jieyou Xu (Joe) <39484203+jieyouxu@users.noreply.github.com>2025-02-19 02:00:02 +0800
commit477a2eeb3dd5a430bb3845c8f8041ff369232967 (patch)
treec3e447dce9d3049dd9e572f1e97304a356cf54ff
parent3b022d8ceea570db9730be34d964f0cc663a567f (diff)
downloadrust-477a2eeb3dd5a430bb3845c8f8041ff369232967.tar.gz
rust-477a2eeb3dd5a430bb3845c8f8041ff369232967.zip
std::fs: slightly reformat `remove_dir_all` error docs
To make the error cases easier to spot on a quick glance.
-rw-r--r--library/std/src/fs.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/library/std/src/fs.rs b/library/std/src/fs.rs
index 6001a2e2f39..2b3a84d0a12 100644
--- a/library/std/src/fs.rs
+++ b/library/std/src/fs.rs
@@ -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.
 ///