Skip to content

Feature: Add Vec::spare_capacity_mut #426

@survived

Description

@survived

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions