Skip to content

Commit

Permalink
Implement AsMut for Vec
Browse files Browse the repository at this point in the history
Fixes #28549
  • Loading branch information
bluss committed Sep 25, 2015
1 parent cff0411 commit 9b97264
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/libcollections/vec.rs
Expand Up @@ -1359,6 +1359,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))]
Expand Down

0 comments on commit 9b97264

Please sign in to comment.