Feature gate: #![feature(vec_fallible_shrink)]
This is a tracking issue for implementing fallible shrink methods on Vec so that they may be used in contexts without global OOM handling.
Public API
// alloc::vec
impl Vec {
pub fn try_shrink_to(&mut self, min_capacity: usize) -> Result<(), TryReserveError>;
pub fn try_shrink_to_fit(&mut self) -> Result<(), TryReserveError>;
}
Steps / History
Unresolved Questions
- Should this use AllocError or TryReserveError?
Feature gate:
#![feature(vec_fallible_shrink)]This is a tracking issue for implementing fallible shrink methods on Vec so that they may be used in contexts without global OOM handling.
Public API
Steps / History
try_shrink_toandtry_shrink_to_fitlibs-team#728Unresolved Questions
Footnotes
https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html ↩