Auto merge of #28663 - bluss:vec-as-mut, r=alexcrichton
Implement AsMut for Vec Fixes #28549
This commit is contained in:
commit
219eca11b0
@ -1354,6 +1354,13 @@ impl<T> AsRef<Vec<T>> for Vec<T> {
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "vec_as_mut", since = "1.5.0")]
|
||||
impl<T> AsMut<Vec<T>> for Vec<T> {
|
||||
fn as_mut(&mut self) -> &mut Vec<T> {
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl<T> AsRef<[T]> for Vec<T> {
|
||||
fn as_ref(&self) -> &[T] {
|
||||
@ -1361,6 +1368,13 @@ impl<T> AsRef<[T]> for Vec<T> {
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "vec_as_mut", since = "1.5.0")]
|
||||
impl<T> AsMut<[T]> for Vec<T> {
|
||||
fn as_mut(&mut self) -> &mut [T] {
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl<'a, T: Clone> From<&'a [T]> for Vec<T> {
|
||||
#[cfg(not(test))]
|
||||
|
Loading…
Reference in New Issue
Block a user