Skip to content

Commit

Permalink
Auto merge of #28663 - bluss:vec-as-mut, r=alexcrichton
Browse files Browse the repository at this point in the history
Implement AsMut for Vec

Fixes #28549
  • Loading branch information
bors committed Sep 27, 2015
2 parents dde7283 + 804efda commit 219eca1
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/libcollections/vec.rs
Expand Up @@ -1354,13 +1354,27 @@ 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] {
self
}
}

#[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))]
Expand Down

0 comments on commit 219eca1

Please sign in to comment.