]> git.lizzy.rs Git - rust.git/commitdiff
Adding more information about the behavior of Arc/Rc
authorAdenilson Cavalcanti <cavalcantii@gmail.com>
Thu, 26 Mar 2015 19:05:21 +0000 (12:05 -0700)
committerAdenilson Cavalcanti <cavalcantii@gmail.com>
Thu, 26 Mar 2015 19:05:21 +0000 (12:05 -0700)
when you perform a clone() call.

src/liballoc/arc.rs
src/liballoc/rc.rs

index b5d16d29272850843e9204749c68e6be9165d56d..b012612af59a2dc1fabab8684f9c468970d00143 100644 (file)
@@ -94,6 +94,9 @@
 /// With simple pipes, without `Arc`, a copy would have to be made for each
 /// task.
 ///
+/// When you clone an `Arc<T>`, it will create another pointer to the data and
+/// increase the reference counter.
+///
 /// ```
 /// # #![feature(alloc, core)]
 /// use std::sync::Arc;
index eb3c5c167268bfe143f68dbef5fb449e6443b8b9..085042ce5a720dbde34945e87abf5a65954a60ac 100644 (file)
@@ -431,7 +431,8 @@ impl<T> Clone for Rc<T> {
 
     /// Makes a clone of the `Rc<T>`.
     ///
-    /// This increases the strong reference count.
+    /// When you clone an `Rc<T>`, it will create another pointer to the data and
+    /// increase the strong reference counter.
     ///
     /// # Examples
     ///