Function style::should_shrink
source · pub(crate) fn should_shrink(len: usize, capacity: usize) -> bool
Expand description
We shrink the capacity of a collection if we’re wasting more than a 25% of its capacity, and if the collection is arbitrarily big enough (>= CAPACITY_THRESHOLD entries).