We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0777c75 commit e70a266Copy full SHA for e70a266
src/libcollections/vec.rs
@@ -1984,6 +1984,18 @@ impl<'a, T: Clone> From<&'a [T]> for Vec<T> {
1984
}
1985
1986
1987
+#[stable(feature = "vec_from_mut", since = "1.21.0")]
1988
+impl<'a, T: Clone> From<&'a mut [T]> for Vec<T> {
1989
+ #[cfg(not(test))]
1990
+ fn from(s: &'a mut [T]) -> Vec<T> {
1991
+ s.to_vec()
1992
+ }
1993
+ #[cfg(test)]
1994
1995
+ ::slice::to_vec(s)
1996
1997
+}
1998
+
1999
#[stable(feature = "vec_from_cow_slice", since = "1.14.0")]
2000
impl<'a, T> From<Cow<'a, [T]>> for Vec<T> where [T]: ToOwned<Owned=Vec<T>> {
2001
fn from(s: Cow<'a, [T]>) -> Vec<T> {
0 commit comments