@@ -140,14 +140,14 @@ impl<T:Freeze+Send> Arc<T> {
140
140
}
141
141
}
142
142
143
- /**
144
- * Duplicate an atomically reference counted wrapper.
145
- *
146
- * The resulting two `arc` objects will point to the same underlying data
147
- * object. However, one of the `arc` objects can be sent to another task,
148
- * allowing them to share the underlying data.
149
- */
150
143
impl < T : Freeze + Send > Clone for Arc < T > {
144
+ /**
145
+ * Duplicate an atomically reference counted wrapper.
146
+ *
147
+ * The resulting two `arc` objects will point to the same underlying data
148
+ * object. However, one of the `arc` objects can be sent to another task,
149
+ * allowing them to share the underlying data.
150
+ */
151
151
fn clone ( & self ) -> Arc < T > {
152
152
Arc { x : self . x . clone ( ) }
153
153
}
@@ -164,7 +164,7 @@ struct MutexArc<T> { priv x: UnsafeAtomicRcBox<MutexArcInner<T>> }
164
164
165
165
166
166
impl < T : Send > Clone for MutexArc < T > {
167
- /// Duplicate a mutex-protected Arc, as arc::clone.
167
+ /// Duplicate a mutex-protected Arc. See arc::clone for more details .
168
168
fn clone ( & self ) -> MutexArc < T > {
169
169
// NB: Cloning the underlying mutex is not necessary. Its reference
170
170
// count would be exactly the same as the shared state's.
@@ -312,12 +312,10 @@ struct RWArc<T> {
312
312
priv x: UnsafeAtomicRcBox<RWArcInner<T>>,
313
313
}
314
314
315
- impl<T:Freeze + Send> RWArc<T> {
316
- /// Duplicate a rwlock-protected Arc, as arc::clone.
317
- pub fn clone(&self) -> RWArc<T> {
318
- RWArc {
319
- x: self.x.clone(),
320
- }
315
+ impl<T:Freeze + Send> Clone for RWArc<T> {
316
+ /// Duplicate a rwlock-protected Arc. See arc::clone for more details.
317
+ fn clone(&self) -> RWArc<T> {
318
+ RWArc { x: self.x.clone() }
321
319
}
322
320
323
321
}
0 commit comments