19 KiB
Releases
2.8.0 (2025-03-10)
- Added
indexmap_with_default!andindexset_with_default!to be used with alternative hashers, especially when using the crate withoutstd. - Implemented
PartialEqbetween eachSliceand[]/arrays. - Removed the internal
rustc-rayonfeature and dependency.
2.7.1 (2025-01-19)
- Added
#[track_caller]to functions that may panic. - Improved memory reservation for
insert_entry.
2.7.0 (2024-11-30)
- Added methods
Entry::insert_entryandVacantEntry::insert_entry, returning anOccupiedEntryafter insertion.
2.6.0 (2024-10-01)
- Implemented
Cloneformap::IntoIterandset::IntoIter. - Updated the
hashbrowndependency to version 0.15.
2.5.0 (2024-08-30)
- Added an
insert_beforemethod toIndexMapandIndexSet, as an alternative toshift_insertwith different behavior on existing entries. - Added
first_entryandlast_entrymethods toIndexMap. - Added
Fromimplementations betweenIndexedEntryandOccupiedEntry.
2.4.0 (2024-08-13)
- Added methods
IndexMap::appendandIndexSet::append, moving all items from one map or set into another, and leaving the original capacity for reuse.
2.3.0 (2024-07-31)
- Added trait
MutableEntryKeyfor opt-in mutable access to map entry keys. - Added method
MutableKeys::iter_mut2for opt-in mutable iteration of map keys and values.
2.2.6 (2024-03-22)
- Added trait
MutableValuesfor opt-in mutable access to set values.
2.2.5 (2024-02-29)
- Added optional
borshserialization support.
2.2.4 (2024-02-28)
- Added an
insert_sortedmethod onIndexMap,IndexSet, andVacantEntry. - Avoid hashing for lookups in single-entry maps.
- Limit preallocated memory in
serdedeserializers.
2.2.3 (2024-02-11)
- Added
move_indexandswap_indicesmethods toIndexedEntry,OccupiedEntry, andRawOccupiedEntryMut, functioning like the existing methods onIndexMap. - Added
shift_insertmethods onVacantEntryandRawVacantEntryMut, as well asshift_insert_hashed_nocheckon the latter, to insert the new entry at a particular index. - Added
shift_insertmethods onIndexMapandIndexSetto insert a new entry at a particular index, or else move an existing entry there.
2.2.2 (2024-01-31)
- Added indexing methods to raw entries:
RawEntryBuilder::from_hash_full,RawEntryBuilder::index_from_hash, andRawEntryMut::index.
2.2.1 (2024-01-28)
- Corrected the signature of
RawOccupiedEntryMut::into_key(self) -> &'a mut K, This a breaking change from 2.2.0, but that version was published for less than a day and has now been yanked.
2.2.0 (2024-01-28)
-
The new
IndexMap::get_index_entrymethod finds an entry by its index for in-place manipulation. -
The
Keysiterator now implementsIndex<usize>for quick access to the entry's key, compared to indexing the map to get the value. -
The new
IndexMap::spliceandIndexSet::splicemethods will drain the given range as an iterator, and then replace that range with entries from an input iterator. -
The new trait
RawEntryApiV1offers opt-in access to a raw entry API forIndexMap, corresponding to the unstable API onHashSetas of Rust 1.75. -
Many
IndexMapandIndexSetmethods have relaxed their type constraints, e.g. removingK: Hashon methods that don't actually need to hash. -
Removal methods
remove,remove_entry, andtakeare now deprecated in favor of theirshift_orswap_prefixed variants, which are more explicit about their effect on the index and order of remaining items. The deprecated methods will remain to guide drop-in replacements fromHashMapandHashSettoward the prefixed methods.
2.1.0 (2023-10-31)
-
Empty slices can now be created with
map::Slice::{new, new_mut}andset::Slice::new. In addition,Slice::new,len, andis_emptyare nowconstfunctions on both types. -
IndexMap,IndexSet, and their respectiveSlices all have binary search methods for sorted data: mapbinary_search_keysand setbinary_searchfor plain comparison,binary_search_byfor custom comparators,binary_search_by_keyfor key extraction, andpartition_pointfor boolean conditions.
2.0.2 (2023-09-29)
- The
hashbrowndependency has been updated to version 0.14.1 to complete the support for Rust 1.63.
2.0.1 (2023-09-27)
- MSRV: Rust 1.63.0 is now supported as well, pending publication of
hashbrown's relaxed MSRV (or use cargo--ignore-rust-version).
2.0.0 (2023-06-23)
-
MSRV: Rust 1.64.0 or later is now required.
-
The
"std"feature is no longer auto-detected. It is included in the default feature set, or else can be enabled like any other Cargo feature. -
The
"serde-1"feature has been removed, leaving just the optional"serde"dependency to be enabled like a feature itself. -
IndexMap::get_index_mutnow returnsOption<(&K, &mut V)>, changing the key part from&mut Kto&K. There is also a new alternativeMutableKeys::get_index_mut2to access the former behavior. -
The new
map::Slice<K, V>andset::Slice<T>offer a linear view of maps and sets, behaving a lot like normal[(K, V)]and[T]slices. Notably, comparison traits likeEqonly consider items in order, rather than hash lookups, and slices even implementHash. -
IndexMapandIndexSetnow havesort_by_cached_keyandpar_sort_by_cached_keymethods which perform stable sorts in place using a key extraction function. -
IndexMapandIndexSetnow havereserve_exact,try_reserve, andtry_reserve_exactmethods that correspond to the same methods onVec. However, exactness only applies to the direct capacity for items, while the raw hash table still follows its own rules for capacity and load factor. -
The
Equivalenttrait is now re-exported from theequivalentcrate, intended as a common base to allow types to work with multiple map types. -
The
hashbrowndependency has been updated to version 0.14. -
The
serde_seqmodule has been moved from the crate root to below themapmodule.
1.9.3 (2023-03-24)
- Bump the
rustc-rayondependency, for compiler use only.
1.9.2 (2022-11-17)
IndexMapandIndexSetboth implementarbitrary::Arbitrary<'_>andquickcheck::Arbitraryif those optional dependency features are enabled.
1.9.1 (2022-06-21)
- The MSRV now allows Rust 1.56.0 as well. However, currently
hashbrown0.12.1 requires 1.56.1, so users on 1.56.0 should downgrade that to 0.12.0 until there is a later published version relaxing its requirement.
1.9.0 (2022-06-16)
-
MSRV: Rust 1.56.1 or later is now required.
-
The
hashbrowndependency has been updated to version 0.12. -
IterMutandValuesMutnow implementDebug. -
The new
IndexMap::shrink_toandIndexSet::shrink_tomethods shrink the capacity with a lower bound. -
The new
IndexMap::move_indexandIndexSet::move_indexmethods change the position of an item from one index to another, shifting the items between to accommodate the move.
1.8.2 (2022-05-27)
- Bump the
rustc-rayondependency, for compiler use only.
1.8.1 (2022-03-29)
- The new
IndexSet::replace_fullwill return the index of the item along with the replaced value, if any, by @zakcutner in PR 222.
1.8.0 (2022-01-07)
-
The new
IndexMap::into_keysandIndexMap::into_valueswill consume the map into keys or values, respectively, matching Rust 1.54'sHashMapmethods, by @taiki-e in PR 195. -
More of the iterator types implement
Debug,ExactSizeIterator, andFusedIterator, by @cuviper in PR 196. -
IndexMapandIndexSetnow implement rayon'sParallelDrainRange, by @cuviper in PR 197. -
IndexMap::with_hasherandIndexSet::with_hasherare nowconstfunctions, allowing static maps and sets, by @mwillsey in PR 203. -
IndexMapandIndexSetnow implementFromfor arrays, matching Rust 1.56's implementation forHashMap, by @rouge8 in PR 205. -
IndexMapandIndexSetnow have methodssort_unstable_keys,sort_unstable_by,sorted_unstable_by, andpar_*equivalents, which sort in-place without preserving the order of equal items, by @bhgomes in PR 211.
1.7.0 (2021-06-29)
-
MSRV: Rust 1.49 or later is now required.
-
The
hashbrowndependency has been updated to version 0.11.
1.6.2 (2021-03-05)
-
Fixed to match
stdbehavior,OccupiedEntry::keynow references the existing key in the map instead of the lookup key, by @cuviper in PR 170. -
The new
Entry::or_insert_with_keymatches Rust 1.50'sEntrymethod, passing&Kto the callback to create a value, by @cuviper in PR 175.
1.6.1 (2020-12-14)
-
The new
serde_seqmodule implementsIndexMapserialization as a sequence to ensure order is preserved, by @cuviper in PR 158. -
New methods on maps and sets work like the
Vec/slice methods by the same name:truncate,split_off,first,first_mut,last,last_mut, andswap_indices, by @cuviper in PR 160.
1.6.0 (2020-09-05)
-
MSRV: Rust 1.36 or later is now required.
-
The
hashbrowndependency has been updated to version 0.9.
1.5.2 (2020-09-01)
- The new "std" feature will force the use of
stdfor users that explicitly want the defaultS = RandomState, bypassing the autodetection added in 1.3.0, by @cuviper in PR 145.
1.5.1 (2020-08-07)
-
Values can now be indexed by their
usizeposition by @cuviper in PR 132. -
Some of the generic bounds have been relaxed to match
stdby @cuviper in PR 141. -
drainnow accepts anyR: RangeBounds<usize>by @cuviper in PR 142.
1.5.0 (2020-07-17)
-
MSRV: Rust 1.32 or later is now required.
-
The inner hash table is now based on
hashbrownby @cuviper in PR 131. This also completes the methodreserveand addsshrink_to_fit. -
Add new methods
get_key_value,remove_entry,swap_remove_entry, andshift_remove_entry, by @cuviper in PR 136 -
Clone::clone_fromreuses allocations by @cuviper in PR 125 -
Add new method
reverseby @linclelinkpart5 in PR 128
1.4.0 (2020-06-01)
-
Add new method
get_index_ofby @Thermatrix in PR 115 and 120 -
Fix build script rebuild-if-changed configuration to use "build.rs"; fixes issue 123. Fix by @cuviper.
-
Dev-dependencies (rand and quickcheck) have been updated. The crate's tests now run using Rust 1.32 or later (MSRV for building the crate has not changed). by @kjeremy and @bluss
1.3.2 (2020-02-05)
- Maintenance update to regenerate the published
Cargo.toml.
1.3.1 (2020-01-15)
- Maintenance update for formatting and
autocfg1.0.
1.3.0 (2019-10-18)
- The deprecation messages in the previous version have been removed. (The methods have not otherwise changed.) Docs for removal methods have been improved.
- From Rust 1.36, this crate supports being built without std, requiring
allocinstead. This is enabled automatically when it is detected thatstdis not available. There is no crate feature to enable/disable to trigger this. The new build-depautocfgenables this.
1.2.0 (2019-09-08)
-
Plain
.remove()now has a deprecation message, it informs the user about picking one of the removal functionsswap_removeandshift_removewhich have different performance and order semantics. Plain.remove()will not be removed, the warning message and method will remain until further. -
Add new method
shift_removefor order preserving removal on the map, andshift_takefor the corresponding operation on the set. -
Add methods
swap_remove,swap_remove_entrytoEntry. -
Fix indexset/indexmap to support full paths, like
indexmap::indexmap!() -
Internal improvements: fix warnings, deprecations and style lints
1.1.0 (2019-08-20)
-
Added optional feature
"rayon"that adds parallel iterator support toIndexMapandIndexSetusing Rayon. This includes all the regular iterators in parallel versions, and parallel sort. -
Implemented
Cloneformap::{Iter, Keys, Values}andset::{Difference, Intersection, Iter, SymmetricDifference, Union} -
Implemented
Debugformap::{Entry, IntoIter, Iter, Keys, Values}andset::{Difference, Intersection, IntoIter, Iter, SymmetricDifference, Union} -
Serde trait
IntoDeserializerare implemented forIndexMapandIndexSet. -
Minimum Rust version requirement increased to Rust 1.30 for development builds.
1.0.2 (2018-10-22)
-
The new methods
IndexMap::insert_fullandIndexSet::insert_fullare both likeinsertwith the index included in the return value. -
The new method
Entry::and_modifycan be used to modify occupied entries, matching the new methods ofstdmaps in Rust 1.26. -
The new method
Entry::or_defaultinserts a default value in unoccupied entries, matching the new methods ofstdmaps in Rust 1.28.
1.0.1 (2018-03-24)
- Document Rust version policy for the crate (see rustdoc)
1.0.0 (2018-03-11)
- This is the 1.0 release for
indexmap! (the crate and datastructure formerly known as “ordermap”) OccupiedEntry::insertchanged its signature, to use&mut selffor the method receiver, matching the equivalent method for a standardHashMap. Thanks to @dtolnay for finding this bug.- The deprecated old names from ordermap were removed:
OrderMap,OrderSet,ordermap!{},orderset!{}. Use the newIndexMapetc names instead.
0.4.1 (2018-02-14)
- Renamed crate to
indexmap; theordermapcrate is now deprecated and the typesOrderMap/Setnow have a deprecation notice.
0.4.0 (2018-02-02)
-
This is the last release series for this
ordermapunder that name, because the crate is going to be renamed toindexmap(with typesIndexMap,IndexSet) and no change in functionality! -
The map and its associated structs moved into the
mapsubmodule of the crate, so that the map and set are symmetric- The iterators,
Entryand other structs are now underordermap::map::
- The iterators,
-
Internally refactored
OrderMap<K, V, S>so that all the main algorithms (insertion, lookup, removal etc) that don't use theSparameter (the hasher) are compiled without depending onS, which reduces generics bloat. -
Entry<K, V>no longer has a type parameterS, which is just like the standardHashMap's entry. -
Minimum Rust version requirement increased to Rust 1.18
0.3.5 (2018-01-14)
- Documentation improvements
0.3.4 (2018-01-04)
- The
.retain()methods forOrderMapandOrderSetnow traverse the elements in order, and the retained elements keep their order - Added new methods
.sort_by(),.sort_keys()toOrderMapand.sort_by(),.sort()toOrderSet. These methods allow you to sort the maps in place efficiently.
0.3.3 (2017-12-28)
- Document insertion behaviour better by @lucab
- Updated dependences (no feature changes) by @ignatenkobrain
0.3.2 (2017-11-25)
- Add
OrderSetby @cuviper! OrderMap::drainis now (too) a double ended iterator.
0.3.1 (2017-11-19)
- In all ordermap iterators, forward the
collectmethod to the underlying iterator as well. - Add crates.io categories.
0.3.0 (2017-10-07)
- The methods
get_pair,get_pair_indexwere both replaced byget_full(and the same for the mutable case). - Method
swap_remove_pairreplaced byswap_remove_full. - Add trait
MutableKeysfor opt-in mutable key access. Mutable key access is only possible through the methods of this extension trait. - Add new trait
Equivalentfor key equivalence. This extends theBorrowtrait mechanism forOrderMap::getin a backwards compatible way, just some minor type inference related issues may become apparent. See #10 for more information. - Implement
Extend<(&K, &V)>by @xfix.
0.2.13 (2017-09-30)
- Fix deserialization to support custom hashers by @Techcable.
- Add methods
.index()on the entry types by @garro95.
0.2.12 (2017-09-11)
- Add methods
.with_hasher(),.hasher().
0.2.11 (2017-08-29)
- Support
ExactSizeIteratorfor the iterators. By @Binero. - Use
Box<[Pos]>internally, saving a word in theOrderMapstruct. - Serde support, with crate feature
"serde-1". By @xfix.
0.2.10 (2017-04-29)
- Add iterator
.drain(..)by @stevej.
0.2.9 (2017-03-26)
- Add method
.is_empty()by @overvenus. - Implement
PartialEq, Eqby @overvenus. - Add method
.sorted_by().
0.2.8 (2017-03-01)
- Add iterators
.values()and.values_mut(). - Fix compatibility with 32-bit platforms.
0.2.7 (2016-11-02)
- Add
.retain().
0.2.6 (2016-11-02)
- Add
OccupiedEntry::remove_entryand other minor entry methods, so that it now has all the features ofHashMap's entries.
0.2.5 (2016-10-31)
- Improved
.pop()slightly.
0.2.4 (2016-10-22)
- Improved performance of
.insert()(#3) by @pczarn.
0.2.3 (2016-10-11)
- Generalize
Entryfor now, so that it works on hashmaps with non-default hasher. However, there's a lingering compat issue since libstdHashMapdoes not parameterize its entries by the hasher (Styparm). - Special case some iterator methods like
.nth().
0.2.2 (2016-10-02)
- Disable the verbose
Debugimpl by default.
0.2.1 (2016-10-02)
- Fix doc links and clarify docs.
0.2.0 (2016-10-01)
- Add more
HashMapmethods & compat with its API. - Experimental support for
.entry()(the simplest parts of the API). - Add
.reserve()(placeholder impl). - Add
.remove()as synonym for.swap_remove(). - Changed
.insert()to swap value if the entry already exists, and returnOption. - Experimental support as an indexed hash map! Added methods
.get_index(),.get_index_mut(),.swap_remove_index(),.get_pair_index(),.get_pair_index_mut().
0.1.2 (2016-09-19)
- Implement the 32/32 split idea for
Poswhich improves cache utilization and lookup performance.
0.1.1 (2016-09-16)
- Initial release.