about summary refs log tree commit diff
path: root/library/std/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-12-31 23:51:34 +0100
committerGitHub <noreply@github.com>2022-12-31 23:51:34 +0100
commit4bf9cae08077fc11ed6ead26ba7714ae828793b3 (patch)
treedc449be55c796cc617e1d84c52e544b7b6240491 /library/std/src
parentdd01a163c1cff9461ddd85e7b3c2c0109657658f (diff)
parent2c4ecffb7758b93c6471efc0f1880b57577f6f5d (diff)
downloadrust-4bf9cae08077fc11ed6ead26ba7714ae828793b3.tar.gz
rust-4bf9cae08077fc11ed6ead26ba7714ae828793b3.zip
Rollup merge of #106280 - Ezrashaw:path-join-docs-better, r=thomcc
docs: add link to `Path::join` in `PathBuf::push`

Fixes #106219

Hopefully my wording is alright.
Diffstat (limited to 'library/std/src')
-rw-r--r--library/std/src/path.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/library/std/src/path.rs b/library/std/src/path.rs
index 3023cac9bcc..ef8a14be73d 100644
--- a/library/std/src/path.rs
+++ b/library/std/src/path.rs
@@ -1246,6 +1246,9 @@ impl PathBuf {
     ///   and `path` is not empty, the new path is normalized: all references
     ///   to `.` and `..` are removed.
     ///
+    /// Consider using [`Path::join`] if you need a new `PathBuf` instead of
+    /// using this function on a cloned `PathBuf`.
+    ///
     /// # Examples
     ///
     /// Pushing a relative path extends the existing path: