Added AsRef implementations for Arc and Rc
This commit is contained in:
@@ -332,6 +332,15 @@ impl<T: ?Sized> Deref for Arc<T> {
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "rc_arc_as_ref", since = "1.2.0")]
|
||||
impl<T: ?Sized> AsRef<T> for Arc<T> {
|
||||
|
||||
#[inline]
|
||||
fn as_ref(&self) -> &T {
|
||||
&self.inner().data
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Clone> Arc<T> {
|
||||
/// Make a mutable reference from the given `Arc<T>`.
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user