diff options
| author | OGINO Masanori <masanori.ogino@gmail.com> | 2014-07-30 05:53:40 +0900 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-07-29 15:44:31 -0700 |
| commit | 02d12e5f71ac37374684439f2f9c36f38b72f63a (patch) | |
| tree | 7338023c7f4b472fefbcd83589d35e9a43444736 /src/liballoc | |
| parent | 04fa9066480d172ffd4b6d02f9edf5b3d31fef56 (diff) | |
| download | rust-02d12e5f71ac37374684439f2f9c36f38b72f63a.tar.gz rust-02d12e5f71ac37374684439f2f9c36f38b72f63a.zip | |
Elide lifetimes around Arc<T>.
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>
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/arc.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs index 1ac2c9fc6be..bf477781aab 100644 --- a/src/liballoc/arc.rs +++ b/src/liballoc/arc.rs @@ -92,7 +92,7 @@ impl<T: Share + Send> 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 @@ impl<T: Share + Send> Clone for 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 @@ impl<T: Share + Send> Weak<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 } } |
