iddqd 0.3.17
·
90 commits
to main
since this release
Added
- Capacity management methods for all map types:
reserve(&mut self, additional: usize)reserves capacity for at leastadditionalmore elements.shrink_to_fit(&mut self)shrinks capacity to fit the current length.shrink_to(&mut self, min_capacity: usize)shrinks capacity to at leastmin_capacity.try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError>: fallible capacity reservation for hash maps (IdHashMap,BiHashMap,TriHashMap).
- New
TryReserveErrortype in theerrorsmodule for reporting allocation failures.
Notes
- For
IdOrdMap, the reserve and shrink methods only affect item storage. The internalBTreeSetused for item ordering does not support capacity control. IdOrdMapdoes not providetry_reserve, since the underlyingBTreeSetdoes not expose fallible reservation operations.
Fixed
- Fixed an instance of potential unsoundness in
retain.
Changed
The Extend implementations now pre-reserve capacity based on the iterator's size_hint.