Skip to content

Commit

Permalink
impl From<[T; N]> for Vec<T>
Browse files Browse the repository at this point in the history
  • Loading branch information
jyn514 committed Mar 10, 2020
1 parent 1581278 commit 6272273
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/liballoc/vec.rs
Expand Up @@ -2397,6 +2397,13 @@ impl<T: Clone> From<&mut [T]> for Vec<T> {
}
}

#[stable(feature = "vec_from_array", since = "1.42.0")]
impl<T, const N: usize> From<[T; N]> for Vec<T> {
fn from(arr: [T; N]) -> Vec<T> {
<[T]>::into_vec(box arr)
}
}

#[stable(feature = "vec_from_cow_slice", since = "1.14.0")]
impl<'a, T> From<Cow<'a, [T]>> for Vec<T>
where
Expand Down

0 comments on commit 6272273

Please sign in to comment.