From 6e3a1eb647cdd945cc47911972498a479674d651 Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Sat, 30 Dec 2023 17:44:29 -0700 Subject: [PATCH] hybrid-array: simplify `From>` impl for `[T; N]` (#1011) If the latter is named specifically as an associated type, then it can simply be moved out of the `Array` newtype. --- hybrid-array/src/lib.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hybrid-array/src/lib.rs b/hybrid-array/src/lib.rs index a9462485..706ae47b 100644 --- a/hybrid-array/src/lib.rs +++ b/hybrid-array/src/lib.rs @@ -351,12 +351,11 @@ where impl From> for [T; N] where Array: ArrayOps, - U: ArraySize, + U: ArraySize = [T; N]>, { #[inline] fn from(arr: Array) -> [T; N] { - let mut items = arr.0.into_iter(); - core::array::from_fn(|_| items.next().expect("should always have item")) + arr.0 } }