Skip to content
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

Feature: Add Vec::spare_capacity_mut #426

Closed
survived opened this issue Dec 17, 2023 · 0 comments · Fixed by #437
Closed

Feature: Add Vec::spare_capacity_mut #426

survived opened this issue Dec 17, 2023 · 0 comments · Fixed by #437

Comments

@survived
Copy link

It'd be great to have spare_capacity_mut method, similar to what alloc::vec::Vec has.

impl<T, const N: usize> Vec<T, N> {
    pub fn spare_capacity_mut(&mut self) -> &mut [MaybeUninit<T>] { /* ... */ }
}

Having access to spare capacity enables certain use-cases, for instance, I wanted to securely zeroize a vector, and to do that I need to zeroize the spare data as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants