Open
Description
Some operations on a Vec<T, N>
are infallible but can only be implemented using fallible methods. What do you think about adding more infallible methods? For example:
from_array(data: [T; N])
: construct aVec
from an array with the same capacity (would also be useful for constants)fill(&mut self, value: T)
: resize to capacity and clonevalue
to empty slotsfill_default(&mut self)
: resize to capacity and writeT::default()
to empty slotsreplace(&mut self, other: &Self)
: clear thisVec
and copy the data fromother