Skip to content

Commit 6272273

Browse files
committed
impl From<[T; N]> for Vec<T>
1 parent 1581278 commit 6272273

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/liballoc/vec.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2397,6 +2397,13 @@ impl<T: Clone> From<&mut [T]> for Vec<T> {
23972397
}
23982398
}
23992399

2400+
#[stable(feature = "vec_from_array", since = "1.42.0")]
2401+
impl<T, const N: usize> From<[T; N]> for Vec<T> {
2402+
fn from(arr: [T; N]) -> Vec<T> {
2403+
<[T]>::into_vec(box arr)
2404+
}
2405+
}
2406+
24002407
#[stable(feature = "vec_from_cow_slice", since = "1.14.0")]
24012408
impl<'a, T> From<Cow<'a, [T]>> for Vec<T>
24022409
where

0 commit comments

Comments
 (0)