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 ba46b61 commit 96794d8Copy full SHA for 96794d8
src/liballoc/vec.rs
@@ -2402,8 +2402,13 @@ impl<T, const N: usize> From<[T; N]> for Vec<T>
2402
where
2403
[T; N]: LengthAtMost32,
2404
{
2405
- fn from(arr: [T; N]) -> Self {
2406
- <[T]>::into_vec(box arr)
+ #[cfg(not(test))]
+ fn from(s: [T; N]) -> Vec<T> {
2407
+ (box s as Box<[T]>).into_vec()
2408
+ }
2409
+ #[cfg(test)]
2410
2411
+ crate::slice::into_vec(box s)
2412
}
2413
2414
0 commit comments