Skip to content

Commit 76287cc

Browse files
committed
libextra: Make arc clone inline
1 parent 7075eb3 commit 76287cc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/libextra/arc.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ impl<T:Freeze + Send> Clone for Arc<T> {
148148
* object. However, one of the `arc` objects can be sent to another task,
149149
* allowing them to share the underlying data.
150150
*/
151+
#[inline]
151152
fn clone(&self) -> Arc<T> {
152153
Arc { x: self.x.clone() }
153154
}
@@ -167,6 +168,7 @@ pub struct MutexArc<T> { priv x: UnsafeArc<MutexArcInner<T>> }
167168

168169
impl<T:Send> Clone for MutexArc<T> {
169170
/// Duplicate a mutex-protected Arc. See arc::clone for more details.
171+
#[inline]
170172
fn clone(&self) -> MutexArc<T> {
171173
// NB: Cloning the underlying mutex is not necessary. Its reference
172174
// count would be exactly the same as the shared state's.
@@ -349,6 +351,7 @@ pub struct RWArc<T> {
349351

350352
impl<T:Freeze + Send> Clone for RWArc<T> {
351353
/// Duplicate a rwlock-protected Arc. See arc::clone for more details.
354+
#[inline]
352355
fn clone(&self) -> RWArc<T> {
353356
RWArc { x: self.x.clone() }
354357
}

0 commit comments

Comments
 (0)