fn from_trusted_iterator<T, const N: usize>(
    iter: impl UncheckedIterator<Item = T>
) -> [T; N]
Expand description

Populate an array from the first N elements of iter

Panics

If the iterator doesn’t actually have enough items.

By depending on TrustedLen, however, we can do that check up-front (where it easily optimizes away) so it doesn’t impact the loop that fills the array.