limit From impl to LengthAtMost32
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
This commit is contained in:
parent
daeb8ece8c
commit
f267d9dc19
1 changed files with 4 additions and 1 deletions
|
@ -2398,7 +2398,10 @@ impl<T: Clone> From<&mut [T]> for Vec<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[stable(feature = "vec_from_array", since = "1.42.0")]
|
#[stable(feature = "vec_from_array", since = "1.42.0")]
|
||||||
impl<T, const N: usize> From<[T; N]> for Vec<T> {
|
impl<T, const N: usize> From<[T; N]> for Vec<T>
|
||||||
|
where
|
||||||
|
[T; N]: LengthAtMost32,
|
||||||
|
{
|
||||||
fn from(arr: [T; N]) -> Self {
|
fn from(arr: [T; N]) -> Self {
|
||||||
<[T]>::into_vec(box arr)
|
<[T]>::into_vec(box arr)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue