mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 15:54:15 +00:00
cd6dad641c
This commit introduces a new method to the public API, under `vec_split_at_spare` feature gate: ```rust impl<T, A: Allocator> impl Vec<T, A> { pub fn split_at_spare_mut(&mut self) -> (&mut [T], &mut [MaybeUninit<T>]); } ``` The method returns 2 slices, one slice references the content of the vector, and the other references the remaining spare capacity. The method was previously implemented while adding `Vec::extend_from_within`, and used to implement `Vec::spare_capacity_mut` (as the later is just a subset of former one). |
||
---|---|---|
.. | ||
benches | ||
src | ||
tests | ||
Cargo.toml |