From 86adb3215f784e58911165b0673ea75953ed5456 Mon Sep 17 00:00:00 2001 From: Jakob Schikowski Date: Tue, 26 Nov 2024 00:12:15 +0100 Subject: [PATCH] Update changelog --- CHANGELOG.md | 6 ++++++ README.md | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c0a4745..66ce065 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ ### Changed - `IntMap::new` is now const and creates an instance with zero capacity, thus will not allocate. The latter is also true for `IntMap::default`. Previously the initial capacity was 4. If you want to restore the old behavior, you can use `IntMap::with_capacity(4)`. +- The prime for hashing `u64` keys has changed. The previous one was `11400714819323198549u64`. If you want to restore the old prime, you can create a wrapper type for the `u64` key and implement `IntKey` for it. +- Make all iterator structs public. + +### Changed Breaking! +- `IntMap` and co. have now a new type parameter `K` that represents the key type. The key can be any primitive integer. Custom types that wrap primitive integers are also supported if they implement `IntKey`. +- The iterator structs return the key by value instead of by reference. ## [2.0.0] 2022-07-17 diff --git a/README.md b/README.md index 7d683d9..32584c5 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,8 @@ test tests::u64_insert_no_op_without_capacity ... bench: 190,528.64 ns/it test tests::u64_resize_intmap ... bench: 55,155.88 ns/iter (+/- 648.32) ``` # Breaking Changes -2.0.0 - Changed behavior of `insert` to match std::HashMap. The old behavior is renamed to `insert_checked`. + +Breaking changes are documented in the [CHANGELOG.md]. # How to use Simple example: