Function core::array::iter_next_chunk
source · pub(crate) fn iter_next_chunk<T, const N: usize>(
iter: &mut impl Iterator<Item = T>
) -> Result<[T; N], IntoIter<T, N>>Expand description
Pulls N items from iter and returns them as an array. If the iterator
yields fewer than N items, Err is returned containing an iterator over
the already yielded items.
Since the iterator is passed as a mutable reference and this function calls
next at most N times, the iterator can still be used afterwards to
retrieve the remaining items.
If iter.next() panicks, all items already yielded by the iterator are
dropped.
Used for Iterator::next_chunk.