fix test failure

This commit is contained in:
Joshua Nelson 2020-02-01 13:15:50 +00:00
parent ba46b61bbc
commit 96794d86f1
1 changed files with 7 additions and 2 deletions

View File

@ -2402,8 +2402,13 @@ impl<T, const N: usize> From<[T; N]> for Vec<T>
where
[T; N]: LengthAtMost32,
{
fn from(arr: [T; N]) -> Self {
<[T]>::into_vec(box arr)
#[cfg(not(test))]
fn from(s: [T; N]) -> Vec<T> {
(box s as Box<[T]>).into_vec()
}
#[cfg(test)]
fn from(s: [T; N]) -> Vec<T> {
crate::slice::into_vec(box s)
}
}