mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-28 03:07:24 +03:00
51b54598a2
Add try_shrink_to and try_shrink_to_fit to Vec Adds the functions `try_shrink_to` and `try_shrink_to_fit` to Vec to allow shrinking in environments without global OOM handling. The implementation differs from the tracking issue as the fallible methods return a `TryReserveError` instead of an `AllocError` as `AllocError` is unstable and does not contain layout information. Tracking: - rust-lang/rust#152350