libextra: Make arc clone inline

This commit is contained in:
Patrick Walton 2013-10-24 13:21:49 -07:00
parent 7075eb3625
commit 76287ccbb0

View File

@ -148,6 +148,7 @@ impl<T:Freeze + Send> Clone for Arc<T> {
* object. However, one of the `arc` objects can be sent to another task,
* allowing them to share the underlying data.
*/
#[inline]
fn clone(&self) -> Arc<T> {
Arc { x: self.x.clone() }
}
@ -167,6 +168,7 @@ pub struct MutexArc<T> { priv x: UnsafeArc<MutexArcInner<T>> }
impl<T:Send> Clone for MutexArc<T> {
/// Duplicate a mutex-protected Arc. See arc::clone for more details.
#[inline]
fn clone(&self) -> MutexArc<T> {
// NB: Cloning the underlying mutex is not necessary. Its reference
// count would be exactly the same as the shared state's.
@ -349,6 +351,7 @@ pub struct RWArc<T> {
impl<T:Freeze + Send> Clone for RWArc<T> {
/// Duplicate a rwlock-protected Arc. See arc::clone for more details.
#[inline]
fn clone(&self) -> RWArc<T> {
RWArc { x: self.x.clone() }
}