From 2c4ecffb7758b93c6471efc0f1880b57577f6f5d Mon Sep 17 00:00:00 2001 From: Ezra Shaw Date: Fri, 30 Dec 2022 14:24:12 +1300 Subject: [PATCH] docs: add link to `Path::join` in `PathBuf::push` --- library/std/src/path.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/library/std/src/path.rs b/library/std/src/path.rs index 73b5056e93267..999f5d3a93f26 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: