11 releases
new 0.2.10 | Feb 8, 2025 |
---|---|
0.2.9 | Feb 7, 2025 |
0.1.0 | Feb 6, 2025 |
#1009 in Data structures
173 downloads per month
Used in 4 crates
(3 directly)
11KB
236 lines
Shrink-to-fit trait for collections.
This crate provides a ShrinkToFit
trait that can be used to shrink-to-fit
collections.
Examples
use shrink_to_fit::ShrinkToFit;
let mut vec = Vec::with_capacity(100);
vec.push(1);
vec.push(2);
vec.push(3);
vec.shrink_to_fit();
assert_eq!(vec.len(), 3);
assert_eq!(vec.capacity(), 3);
Dependencies
~0–500KB