Closed
Description
Currently there is only one way to reduce the capacity of a Vec
without clearing it completely: vec.shrink_to_fit()
However, often more control is needed. For example, it's common to want to shrink the capacity, but not below some threshold, eg. vec.shrink_to(MIN_CAPACITY)
.
There are probably other cases where you would want to be able to more directly control the capacity too.