]> git.lizzy.rs Git - rust.git/commitdiff
Elide lifetimes around Arc<T>.
authorOGINO Masanori <masanori.ogino@gmail.com>
Tue, 29 Jul 2014 20:53:40 +0000 (05:53 +0900)
committerAlex Crichton <alex@alexcrichton.com>
Tue, 29 Jul 2014 22:44:31 +0000 (15:44 -0700)
It's a small step forward in application of RFC 39 to the code base
itself.

Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
src/liballoc/arc.rs

index 1ac2c9fc6bec60520e0c1268350df722d7975dac..bf477781aabf6a8207d61956fc5682013783bb46 100644 (file)
@@ -92,7 +92,7 @@ pub fn new(data: T) -> Arc<T> {
     }
 
     #[inline]
-    fn inner<'a>(&'a self) -> &'a ArcInner<T> {
+    fn inner(&self) -> &ArcInner<T> {
         // 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 @@ fn clone(&self) -> Arc<T> {
 #[experimental = "Deref is experimental."]
 impl<T: Send + Share> Deref<T> for Arc<T> {
     #[inline]
-    fn deref<'a>(&'a self) -> &'a T {
+    fn deref(&self) -> &T {
         &self.inner().data
     }
 }
@@ -155,7 +155,7 @@ impl<T: Send + Share + Clone> Arc<T> {
     /// 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 @@ pub fn upgrade(&self) -> Option<Arc<T>> {
     }
 
     #[inline]
-    fn inner<'a>(&'a self) -> &'a ArcInner<T> {
+    fn inner(&self) -> &ArcInner<T> {
         // See comments above for why this is "safe"
         unsafe { &*self._ptr }
     }