You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice for ArrayVec to have an ergonomic method to take out N elements of an iterator. This would be analogous to the next_chunk iterator method, which however never produces an error, as if there is not enough elements to fill out the whole capacity of the ArrayVec, the length can be smaller to accomodate that.
The result is a simpler type ArrayVec<T, N> rather than a Result<[T; N], IntoIter<T, N>> returned by next_chunk.
Proposal:
// N becomes the capacity of the ArrayVeclet arr_vec = ArrayVec::take_from_iter::<N>(iter);// alternatively an iterator method to extract at most N elementslet arr_vec = iter.next_array::<N>()
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
It would be nice for ArrayVec to have an ergonomic method to take out
N
elements of an iterator. This would be analogous to thenext_chunk
iterator method, which however never produces an error, as if there is not enough elements to fill out the whole capacity of the ArrayVec, the length can be smaller to accomodate that.The result is a simpler type
ArrayVec<T, N>
rather than aResult<[T; N], IntoIter<T, N>>
returned bynext_chunk
.Proposal:
What do you think?
Beta Was this translation helpful? Give feedback.
All reactions