-
Notifications
You must be signed in to change notification settings - Fork 181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Infallible Vec operations #341
Comments
For |
Good to see My use case for For |
@robin-nitrokey, can you give a full example on how Maybe |
I don’t think Here is a real world example:
Here,
|
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
The text was updated successfully, but these errors were encountered: