#shrink #fit #shrink-to-fit

shrink-to-fit

Recursively calls shrink_to_fit on all elements of the container

11 releases

0.2.10 Feb 8, 2025
0.2.9 Feb 7, 2025
0.1.0 Feb 6, 2025

#429 in Procedural macros

Download history 245/week @ 2025-02-01 1019/week @ 2025-02-08 732/week @ 2025-02-15 780/week @ 2025-02-22 822/week @ 2025-03-01 516/week @ 2025-03-08 1008/week @ 2025-03-15 735/week @ 2025-03-22

3,204 downloads per month
Used in 4 crates (3 directly)

Apache-2.0

11KB
236 lines

ddbase

Commons library for Rust by Dudy.


lib.rs:

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–495KB