From 049667ef4443c01fe16d291288276fee34b23390 Mon Sep 17 00:00:00 2001 From: OGINO Masanori Date: Wed, 30 Jul 2014 05:53:40 +0900 Subject: [PATCH] Elide lifetimes around Arc. It's a small step forward in application of RFC 39 to the code base itself. Signed-off-by: OGINO Masanori --- src/liballoc/arc.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs index 1ac2c9fc6bec6..bf477781aabf6 100644 --- a/src/liballoc/arc.rs +++ b/src/liballoc/arc.rs @@ -92,7 +92,7 @@ impl Arc { } #[inline] - fn inner<'a>(&'a self) -> &'a ArcInner { + fn inner(&self) -> &ArcInner { // This unsafety is ok because while this arc is alive we're guaranteed // that the inner pointer is valid. Furthermore, we know that the // `ArcInner` structure itself is `Share` because the inner data is @@ -142,7 +142,7 @@ impl Clone for Arc { #[experimental = "Deref is experimental."] impl Deref for Arc { #[inline] - fn deref<'a>(&'a self) -> &'a T { + fn deref(&self) -> &T { &self.inner().data } } @@ -155,7 +155,7 @@ impl Arc { /// data is cloned if the reference count is greater than one. #[inline] #[experimental] - pub fn make_unique<'a>(&'a mut self) -> &'a mut T { + pub fn make_unique(&mut self) -> &mut T { // Note that we hold a strong reference, which also counts as // a weak reference, so we only clone if there is an // additional reference of either kind. @@ -238,7 +238,7 @@ impl Weak { } #[inline] - fn inner<'a>(&'a self) -> &'a ArcInner { + fn inner(&self) -> &ArcInner { // See comments above for why this is "safe" unsafe { &*self._ptr } }