about summary refs log tree commit diff
path: root/library/std/src/path.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-04-17 19:21:44 +0000
committerbors <bors@rust-lang.org>2024-04-17 19:21:44 +0000
commitd261b5308111fa95427fcfdfd53a8331dd44a2b6 (patch)
tree8a985a2ac605d07089841ac906e13601c9d06390 /library/std/src/path.rs
parent9776f647e67cadaa8c5f56a04c933c72fe27ccbc (diff)
parent7c3c2716ff46fb3276c16bdaea226e5a5abc08c0 (diff)
downloadrust-d261b5308111fa95427fcfdfd53a8331dd44a2b6.tar.gz
rust-d261b5308111fa95427fcfdfd53a8331dd44a2b6.zip
Auto merge of #3481 - RalfJung:rustup, r=RalfJung
Rustup
Diffstat (limited to 'library/std/src/path.rs')
-rw-r--r--library/std/src/path.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/library/std/src/path.rs b/library/std/src/path.rs
index 5f43d63bf84..0636f55771e 100644
--- a/library/std/src/path.rs
+++ b/library/std/src/path.rs
@@ -1628,6 +1628,10 @@ impl Clone for PathBuf {
         PathBuf { inner: self.inner.clone() }
     }
 
+    /// Clones the contents of `source` into `self`.
+    ///
+    /// This method is preferred over simply assigning `source.clone()` to `self`,
+    /// as it avoids reallocation if possible.
     #[inline]
     fn clone_from(&mut self, source: &Self) {
         self.inner.clone_from(&source.inner)