Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from bluss:master #5

Open
wants to merge 326 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
326 commits
Select commit Hold shift + click to select a range
42fab99
Use a more standard way to seal MutableKeys
cuviper Feb 9, 2022
94d1197
Add shrink_to
cuviper Feb 9, 2022
18b8a6f
no_std has to opt-out of default features
cuviper Feb 9, 2022
c715675
Fix clippy::needless_borrow
cuviper Mar 29, 2022
a31003c
Merge pull request #219 from cuviper/v2
cuviper Mar 29, 2022
4fba592
Add dynamically-sized slices of maps and sets
cuviper Feb 28, 2021
e2c6a2f
Create parallel iterators from slices
cuviper Feb 28, 2021
45852b7
`impl Index<(Bound<usize>, Bound<usize>)>` like Rust 1.53
cuviper May 26, 2021
7f9af49
Add `get_range` and `get_range_mut`
cuviper May 26, 2021
20c0506
impl Default for &mut map::Slice, like normal slices
cuviper May 27, 2021
949c9a9
Add tests of slice indexing
cuviper May 27, 2021
e9024a3
Move some slice methods for better doc order
cuviper May 27, 2021
7304afc
impl Serialize for {map,set}::Slice
cuviper May 27, 2021
0241a18
Remove outdated comment on get_index_mut
cuviper Apr 1, 2022
7242c54
Use built-in indexing for Bound pairs
cuviper Apr 1, 2022
9f2b14d
Hide unnecessary iterator visibility
cuviper Apr 1, 2022
8c49292
Add boxed slices, including owned iterators
cuviper Apr 2, 2022
2d3b165
impl {Default,Clone,From<&Slice>} for Box<Slice>
cuviper Apr 2, 2022
49836c6
use more a direct Box<Slice> from &Slice
cuviper Apr 4, 2022
4750dc7
Documentation assertion in erase_index function
stepancheg Apr 15, 2022
1583860
Merge pull request #224 from stepancheg/erase-index
cuviper Apr 27, 2022
eac27f1
Add a release note for Slice
cuviper May 7, 2022
8a571c6
Bump MSRV to 1.56.1, matching hashbrown as of 0.12.1
cuviper May 7, 2022
5ba716b
Merge pull request #177 from cuviper/slice
cuviper May 7, 2022
0937707
Use first-class patterns for split_first/last
cuviper May 7, 2022
cda1a0b
cargo fmt
cuviper May 7, 2022
adb8c10
typo fix
cuviper May 7, 2022
ebe2f29
Remove outdated references to serde-1
cuviper May 7, 2022
c88bb7d
Merge pull request #225 from cuviper/slice-patterns
cuviper May 7, 2022
54a48d2
Add move_index to change the position of an entry
cuviper Feb 27, 2021
6b425e4
Add an MSRV note for retain_mut
cuviper May 19, 2022
d110067
Use `u8` test indices so quickcheck is less likely to go out of bounds.
cuviper May 23, 2022
3848768
Add a release note for move_index
cuviper May 24, 2022
793f6d1
Merge pull request #176 from cuviper/move_index
cuviper May 24, 2022
8e7691d
Update rustc-rayon to 0.4
cuviper May 27, 2022
2109261
Merge pull request #228 from cuviper/rustc-rayon-0.4
cuviper May 27, 2022
e49cdbc
Remove internal patterns in `indexmap!` and `indexset!`
cuviper Jun 6, 2022
ccffb84
Merge pull request #230 from cuviper/macro-counts
cuviper Jun 6, 2022
2f731f1
Sync release log from 1.9.0
cuviper Jun 17, 2022
97c4efe
Fix the RELEASES.md link
cuviper Jun 17, 2022
f6487e7
Revert "Bump MSRV to 1.56.1, matching hashbrown as of 0.12.1"
dtolnay Jun 17, 2022
b6aa495
Run CI on 1.56.1 until next hashbrown release
dtolnay Jun 17, 2022
0d5781b
Merge pull request #232 from dtolnay-contrib/rustversion
cuviper Jun 17, 2022
b283dd7
Release 1.9.1
cuviper Jun 21, 2022
68f4f03
Move map::tests to its own file
cuviper Jul 12, 2022
63c0229
Move set::tests to its own file
cuviper Jul 12, 2022
0662f01
Move map iterators to their own file
cuviper Jul 12, 2022
36c918d
Move set iterators to their own file
cuviper Jul 12, 2022
9a5b1fa
Merge pull request #236 from cuviper/modules
cuviper Jul 13, 2022
d51af52
Update to actions/checkout@v3
cuviper Jul 14, 2022
2e3b3c5
Switch from actions-rs/toolchain to dtolnay/rust-toolchain
cuviper Jul 14, 2022
7104832
Merge pull request #237 from cuviper/ci-actions
cuviper Jul 14, 2022
aa4ee74
Revert "Run CI on 1.56.1 until next hashbrown release"
cuviper Jul 15, 2022
0589eb8
Upgrade to hashbrown 0.13 (MSRV 1.61)
cuviper Nov 11, 2022
d355f11
Merge pull request #243 from cuviper/hashbrown-0.13
cuviper Nov 16, 2022
3e78c62
impl Arbitrary for IndexMap and IndexSet
cuviper Nov 17, 2022
cc4c47d
Add an Arbitrary release note
cuviper Nov 17, 2022
8e4cc9a
Merge pull request #246 from cuviper/arbitrary
cuviper Nov 17, 2022
8b7f398
Add `sort_by_cached_key` and `par_sort_by_cached_key`
cuviper Nov 16, 2022
2251730
Merge pull request #244 from cuviper/sort_by_cached_key
cuviper Nov 17, 2022
0d40bae
Add `reserve_exact`, `try_reserve`, `try_reserve_exact`
cuviper Nov 16, 2022
dbf20da
Be more careful about reserving entries capacity
cuviper Nov 17, 2022
570e1b2
Add a release note for new reserve methods
cuviper Nov 17, 2022
882c8f9
Only grow entries if necessary, since we also round up capacity
cuviper Nov 17, 2022
afb75dc
Merge pull request #245 from cuviper/more-reserves
cuviper Nov 17, 2022
ca5f848
Release 1.9.2
cuviper Nov 17, 2022
d0243c3
Use Vec::retain_mut
cuviper Nov 18, 2022
beb7966
Merge pull request #250 from cuviper/vec-retain_mut
cuviper Nov 18, 2022
a45f31e
Add more slicing methods to iterators, like std
cuviper Nov 18, 2022
eedabac
Merge pull request #251 from cuviper/more-slicing
cuviper Nov 18, 2022
9753b89
Fix some typos
striezel Jan 26, 2023
1f308f1
Merge pull request #255 from striezel-stash/fix-some-typos
cuviper Jan 27, 2023
e66f3b2
Highlight feature-gated items in documentation
rjsberry Jan 30, 2023
193157c
Improve feature flag documentation
rjsberry Jan 30, 2023
3704131
Tidy up feature flag documentation
rjsberry Feb 27, 2023
fb46d53
Move `serde_seq` module from crate root to `map`
rjsberry Feb 27, 2023
d996ac3
Fix docs.rs metadata
rjsberry Feb 28, 2023
42b03b4
Fix broken docstring links
rjsberry Feb 28, 2023
eb8a639
Document `arbitrary` and `quickcheck` features
rjsberry Feb 28, 2023
8f26bbc
Add note on moved `serde_seq` module to RELEASES
rjsberry Feb 28, 2023
8ff3168
Merge pull request #256 from rjsberry/feature-flag-docs
cuviper Feb 28, 2023
11ac52c
[1.x] Update rustc-rayon to 0.5, and release 1.9.3
cuviper Mar 24, 2023
704bf5a
Implement Default for iterators
KamilaBorowska May 30, 2023
c94ed9a
Upgrade to hashbrown 0.14 (MSRV 1.64)
daxpedda Jun 6, 2023
ec1fbce
Address review
daxpedda Jun 6, 2023
d62f837
Merge pull request #261 from xfix/iter-default-implementation
cuviper Jun 6, 2023
ee71507
Merge pull request #262 from daxpedda/hashbrown-v0.14
cuviper Jun 6, 2023
c37dae6
Use hashbrown's new single-lookup insertion
cuviper Jun 6, 2023
bb48357
Merge pull request #263 from cuviper/insert_in_slot
cuviper Jun 6, 2023
6d83bc1
pub use equivalent::Equivalent;
cuviper Jun 6, 2023
677c605
Add a relnote for Equivalent
cuviper Jun 7, 2023
74e14da
Merge pull request #264 from cuviper/equivalent
cuviper Jun 23, 2023
d3ea289
Document the lower-bound semantics of capacity
cuviper Jun 23, 2023
b5b2814
Merge pull request #266 from cuviper/doc-capacity
cuviper Jun 23, 2023
ad694fb
Release 2.0.0
cuviper Jun 23, 2023
8e47be8
Merge pull request #267 from cuviper/release-2.0.0
cuviper Jun 23, 2023
73b4b53
Upgrade to itertools 0.11
cuviper Jul 22, 2023
1ce0afe
Merge pull request #270 from cuviper/itertools-0.11
cuviper Jul 22, 2023
8360847
Test `direct-minimal-versions`
daxpedda Aug 11, 2023
9469a1b
Merge pull request #272 from daxpedda/minimal-versions
cuviper Aug 11, 2023
77c58aa
Improve explanation about `IndexSet`'s complexity.
Aug 16, 2023
0604c5b
Merge pull request #273 from your-diary/docs/indexset
cuviper Aug 16, 2023
8e03753
Use `RawTable::get_many_mut` for safe `swap_indices`
cuviper Sep 6, 2023
2eaf59c
Merge pull request #275 from cuviper/safe-swap
cuviper Sep 6, 2023
9dcae76
Release 2.0.1 with `rust-version = "1.63"`
cuviper Sep 27, 2023
fbd129f
Merge pull request #276 from cuviper/release-2.0.1
cuviper Sep 27, 2023
9de727d
Release 2.0.2 with complete MSRV 1.63
cuviper Sep 29, 2023
67e67dd
Merge pull request #277 from cuviper/release-2.0.2
cuviper Sep 29, 2023
0187071
Add `Slice::new` and `new_mut` for empty slices
cuviper Oct 4, 2023
348b42f
add binary_search and friends
Eh2406 Oct 24, 2023
d93534f
add tests
Eh2406 Oct 26, 2023
0d5ee80
Merge pull request #278 from cuviper/slice-new
cuviper Oct 27, 2023
3263c0f
fix wording
Eh2406 Oct 26, 2023
1350db6
Capitalize "see" in binary search docs
cuviper Oct 31, 2023
eec4c43
Add plain binary search to maps and sets too
cuviper Oct 31, 2023
7326a6e
Re-wrap the binary search docs
cuviper Oct 31, 2023
cd641d2
Merge pull request #282 from Eh2406/binary_search
cuviper Oct 31, 2023
f1ea007
Release 2.1.0
cuviper Oct 31, 2023
ff49792
Merge pull request #283 from cuviper/release-2.1.0
cuviper Oct 31, 2023
555f6ea
`impl Index<usize> for Keys`
cuviper Nov 1, 2023
af4e1a5
Remove doc `html_root_url`
zachs18 Dec 29, 2023
7e0862c
Merge pull request #292 from zachs18/patch-1
cuviper Dec 30, 2023
10ced83
Add method to get a map entry by index
bkragl Jan 1, 2024
c42f933
Re-deprecate `remove`, `remove_entry`, and `take`
cuviper Jan 12, 2024
b71b00d
Reorder `OccupiedEntry` methods for better docs
cuviper Jan 12, 2024
5fc8277
Move `get_index_entry` to an unconstrained `impl`
cuviper Jan 12, 2024
84f772d
Merge pull request #290 from bkragl/entry_at
cuviper Jan 12, 2024
fda1ec4
Merge pull request #285 from cuviper/index-keys
cuviper Jan 12, 2024
82bc7b3
Update the remove-order note in the README
cuviper Jan 13, 2024
cd74680
Merge pull request #293 from cuviper/deprecate-remove
cuviper Jan 13, 2024
1e873cc
Use more rustdoc auto-links
cuviper Jan 15, 2024
5c7e734
Merge pull request #295 from cuviper/doc-links
cuviper Jan 15, 2024
908084e
Relax some over-constrained impl bounds
cuviper Jan 16, 2024
f7cf609
Merge pull request #296 from cuviper/relax
cuviper Jan 16, 2024
4a00bd3
Update all links to the indexmap-rs org
cuviper Jan 17, 2024
09bb462
Merge pull request #297 from cuviper/org-links
cuviper Jan 17, 2024
ec86349
CI: Add a "Complete" job for branch protection
cuviper Jan 17, 2024
b5b5493
Merge pull request #298 from cuviper/ci-merge
cuviper Jan 17, 2024
33155c7
Add splicing iterators
cuviper Jan 12, 2024
282ba6e
Merge pull request #294 from cuviper/splice
cuviper Jan 17, 2024
d79a215
Refactor `Entry` with more separation from the `raw` part
cuviper Jan 16, 2024
e787b3d
Add a core method to support set's `replace_full`
cuviper Jan 24, 2024
aed1204
Merge pull request #299 from cuviper/refactor-entry
cuviper Jan 24, 2024
1f80ad9
Opt-in access to the experimental raw entry API.
cuviper Jan 16, 2024
5c5d238
Rename RawEntryV1 to RawEntryApiV1
cuviper Jan 17, 2024
e646424
Adapt some of hashbrown's raw entry docs as our own
cuviper Jan 24, 2024
54c487e
Add raw entry `Debug`
cuviper Jan 24, 2024
77382d6
Remove unnecessary `stringify!`
cuviper Jan 24, 2024
a1495fd
Merge pull request #301 from cuviper/unstringify
cuviper Jan 24, 2024
9edb1a4
Merge pull request #300 from cuviper/raw_entry_v1
cuviper Jan 28, 2024
d84bf5e
Release 2.2.0
cuviper Jan 28, 2024
405fa10
Merge pull request #302 from cuviper/release-2.2.0
cuviper Jan 28, 2024
904689f
ci: upgrade to actions/checkout@v4
cuviper Jan 28, 2024
382a45c
Upgrade dev-dep itertools to 0.12
cuviper Jan 28, 2024
34a7af7
Allow `clippy::style`
cuviper Jan 28, 2024
7107c49
Merge pull request #303 from cuviper/test-updates
cuviper Jan 28, 2024
244bd81
Fix `RawOccupiedEntryMut::into_key`
cuviper Jan 29, 2024
7264ce4
Merge pull request #304 from cuviper/raw-into_key
cuviper Jan 29, 2024
54a42ec
Add indexing methods to raw entry
cuviper Jan 30, 2024
f4bb006
Release 2.2.2
cuviper Jan 31, 2024
1a50e7b
Merge pull request #305 from cuviper/raw_entry-index
cuviper Jan 31, 2024
685c8ff
Releases: Adjust markdown format
Turbo87 Feb 1, 2024
76b4232
Make the CI status more robust
cuviper Feb 1, 2024
4d35cbd
Merge pull request #307 from cuviper/ci-robust
cuviper Feb 1, 2024
2044a2e
Merge pull request #306 from Turbo87/patch-1
cuviper Feb 1, 2024
12e3161
ci: Use a single action to collect final status
cuviper Feb 6, 2024
c7875ef
ci: Simplify toolchain in minimal-versions
cuviper Feb 6, 2024
2d8fdb8
ci: Add a registry cache for git protocol
cuviper Feb 6, 2024
3ac86a4
Merge pull request #309 from cuviper/ci
cuviper Feb 6, 2024
5190778
Add more indexed methods to entries
cuviper Feb 10, 2024
ec26c8e
Add quickchecks for new methods
cuviper Feb 11, 2024
3264695
quick: use more normal Entry names
cuviper Feb 11, 2024
209e3e1
Document equivalence of move_index/swap_indices
cuviper Feb 11, 2024
3b217ca
Add `IndexMap::shift_insert` based on `Entry`
cuviper Feb 11, 2024
4572493
Add `IndexSet::shift_insert` based on map's method
cuviper Feb 11, 2024
5debe73
IndexSet::swap_indices is O(1) too
cuviper Feb 11, 2024
8c206ef
Test shift_insert that moves
cuviper Feb 11, 2024
2a33977
Fully mask the `"test_debug"` code from normal builds
cuviper Feb 11, 2024
e3ff25b
Merge pull request #311 from cuviper/test_debug
cuviper Feb 11, 2024
8e6753c
Merge pull request #310 from cuviper/shift_insert
cuviper Feb 11, 2024
3b79b87
Release 2.2.3
cuviper Feb 11, 2024
406bbdb
Merge pull request #312 from cuviper/release-2.2.3
cuviper Feb 11, 2024
8b98253
Avoid hashing for single-entry maps
cuviper Feb 25, 2024
e0a7f23
Merge pull request #316 from cuviper/trivial-search
cuviper Feb 26, 2024
1d7b8e2
Add `insert_sorted`
cuviper Feb 24, 2024
9deec7c
Merge pull request #315 from cuviper/insert_sorted
cuviper Feb 26, 2024
fac3148
Limit preallocation in deserializers
cuviper Feb 26, 2024
43b322e
Merge pull request #317 from cuviper/serde-size_hint
cuviper Feb 27, 2024
7e64de1
Simplify `cautious_capacity` since `Bucket` is never a ZST
cuviper Feb 29, 2024
cdebfe8
Merge pull request #318 from cuviper/cautious_capacity
cuviper Feb 29, 2024
271b5ae
Release 2.2.4
cuviper Feb 29, 2024
4df99d8
Merge pull request #319 from cuviper/release-2.2.4
cuviper Feb 29, 2024
ae38b91
Add `borsh` dep to Cargo manifest
sug0 Feb 20, 2024
0804a16
Implement `borsh` serialization routines
sug0 Feb 20, 2024
c610e14
Add `borsh` serialization roundtrip tests
sug0 Feb 20, 2024
6ad3e42
Include `borsh` in CI workflow
sug0 Feb 26, 2024
b8b1f52
ci: reduce features on MSRV
cuviper Feb 28, 2024
32793f1
Don't require BuildHasher in BorshSerialize
cuviper Feb 28, 2024
b81a4d2
Use S for the BuildHasher parameter
cuviper Feb 28, 2024
c934ace
Merge pull request #313 from heliaxdev/heliax/borsh-support
cuviper Feb 29, 2024
5d7bd5e
Release 2.2.5
cuviper Feb 29, 2024
184fe4b
Merge pull request #320 from cuviper/release-2.2.5
cuviper Feb 29, 2024
210b027
Opt-in mutable access on IndexSet
cuviper Mar 20, 2024
0060546
Release 2.2.6
cuviper Mar 22, 2024
b76ff73
Fix `clippy::multiple_bound_locations`
cuviper Mar 22, 2024
33c1a7c
Fix `unused_imports`
cuviper Mar 22, 2024
3f0fffb
Merge pull request #323 from cuviper/mutable
cuviper Mar 23, 2024
ac2a8a5
deps(dev): Update `itertools`
waywardmonkeys May 21, 2024
1a71dde
Merge pull request #327 from waywardmonkeys/dep-update-dev-dep-itertools
cuviper May 21, 2024
8222a59
Fix missing indentation in doc comment.
waywardmonkeys Jul 26, 2024
7f7d39f
Merge pull request #332 from waywardmonkeys/missing-indentation-in-do…
cuviper Jul 26, 2024
65c3c46
feat(map): Add MutableEntryKey
epage Jul 28, 2024
6049d51
feat(map): Add MutableKeys::iter_mut2
epage Jul 28, 2024
39f7cc0
Release 2.3.0
cuviper Jul 31, 2024
22c0b4e
Merge pull request #335 from epage/mut
cuviper Jul 31, 2024
8c0a1cd
Add `append` methods
cuviper Aug 13, 2024
0b2b4b9
Release 2.4.0
cuviper Aug 13, 2024
a288bf3
Add a README note for `ordermap`
cuviper Aug 13, 2024
b66bbfe
Merge pull request #337 from cuviper/append
cuviper Aug 13, 2024
b44138b
Move the `MutableEntryKey::key_mut` doc to the trait
cuviper Aug 21, 2024
9b93dd5
Update `package.metadata.release`
cuviper Aug 21, 2024
ba16981
Implement `From` between `IndexedEntry` and `OccupiedEntry`
cuviper Aug 27, 2024
e1f5f26
Add `first_entry` and `last_entry` similar to `BTreeMap`
cuviper Aug 27, 2024
264e5b7
Add doc aliases like `BTreeMap`/`BTreeSet`
cuviper Aug 27, 2024
b63e4a1
Merge pull request #341 from cuviper/from-entry
cuviper Aug 28, 2024
e482e17
Merge pull request #342 from cuviper/btree-like
cuviper Aug 28, 2024
922c6ad
Update the CI badge
cuviper Aug 28, 2024
0247a15
Document and assert index bounds in `shift_insert`
cuviper Aug 27, 2024
7224def
Add `insert_before` as an alternate to `shift_insert`
cuviper Aug 27, 2024
8ca01b0
Use `insert_before` for "new" entries in `insert_sorted`
cuviper Aug 27, 2024
1d9b5e3
Add doc examples for `insert_before` and `shift_insert`
cuviper Aug 29, 2024
139d7ad
Merge pull request #340 from cuviper/insert-bounds
cuviper Aug 30, 2024
48ed490
Release 2.5.0
cuviper Aug 30, 2024
abdd155
Merge pull request #344 from cuviper/release-2.5.0
cuviper Aug 30, 2024
efa81da
Test the various heuristics of `erase_indices`
cuviper Sep 12, 2024
6328647
Merge pull request #347 from cuviper/test-erase_indices
cuviper Sep 13, 2024
5d9cb11
Derive `Clone` for `{map,set}::IntoIter`
cuviper Sep 16, 2024
15518f3
Merge pull request #348 from cuviper/clone-intoiter
cuviper Sep 16, 2024
5b0ed20
docs: Improve doc formatting with backticks
waywardmonkeys Sep 17, 2024
d74a4da
Merge pull request #349 from waywardmonkeys/improve-doc-formatting
cuviper Sep 17, 2024
267b83d
Add an explicit bounds check in `move_index`
cuviper Sep 27, 2024
09b48ec
Merge pull request #353 from cuviper/move_index
cuviper Sep 27, 2024
e577bf2
Use `hashbrown::HashTable` instead of `RawTable`
cuviper Oct 1, 2024
7f80229
Merge pull request #343 from cuviper/hash_table
cuviper Oct 1, 2024
5340049
Release 2.6.0
cuviper Oct 1, 2024
bd0b4f7
Add all release dates
cuviper Oct 1, 2024
bf0362b
Merge pull request #354 from cuviper/release-2.6.0
cuviper Oct 1, 2024
7d8cef8
Use rayon-1.9.0's `collect_vec_list`
cuviper Nov 13, 2024
c095322
ci: downgrade hashbrown for 1.63
cuviper Nov 13, 2024
dceb0f0
Merge pull request #360 from cuviper/collect_vec_list
cuviper Nov 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 84 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ on:
branches: [ master ]
pull_request:
branches: [ master ]
merge_group:

name: Continuous integration
name: CI

env:
CARGO_TERM_COLOR: always
Expand All @@ -16,28 +17,42 @@ jobs:
strategy:
matrix:
include:
- rust: 1.36.0 # MSRV
- rust: 1.63.0 # MSRV
features:
- rust: stable
features: serde
features: arbitrary
- rust: stable
features: quickcheck
- rust: stable
features: rayon
- rust: stable
features: rustc-rayon
- rust: stable
features: serde
- rust: stable
features: borsh
- rust: stable
features: std
- rust: beta
features:
- rust: nightly
bench: test build benchmarks
- rust: nightly
features: test_low_transition_point

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
- uses: actions/checkout@v4
- uses: actions/cache@v4
if: matrix.rust == '1.63.0'
with:
path: ~/.cargo/registry/index
key: cargo-git-index
- uses: dtolnay/rust-toolchain@master
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- name: Downgrade dependencies
if: matrix.rust == '1.63.0'
run: |
cargo generate-lockfile
cargo update -p hashbrown --precise 0.15.0
- name: Tests
run: |
cargo build --verbose --features "${{ matrix.features }}"
Expand All @@ -57,37 +72,81 @@ jobs:
strategy:
matrix:
include:
- rust: 1.36.0
- rust: 1.63.0
target: thumbv6m-none-eabi
- rust: stable
target: thumbv6m-none-eabi

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
- uses: actions/checkout@v4
- uses: actions/cache@v4
if: matrix.rust == '1.63.0'
with:
path: ~/.cargo/registry/index
key: cargo-git-index
- uses: dtolnay/rust-toolchain@master
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
target: ${{ matrix.target }}
- name: Downgrade dependencies
if: matrix.rust == '1.63.0'
run: |
cargo generate-lockfile
cargo update -p hashbrown --precise 0.15.0
- name: Tests
run: |
cargo build -vv --target=${{ matrix.target }}
cargo build -vv --target=${{ matrix.target }} --no-default-features
cargo build -v -p test-nostd --target=${{ matrix.target }}

clippy:
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- beta
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@beta
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
components: clippy
- run: cargo clippy
- run: cargo clippy --all-features

miri:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
components: miri
- run: cargo miri test

minimal-versions:
name: Check MSRV and minimal-versions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ~/.cargo/registry/index
key: cargo-git-index
- uses: dtolnay/rust-toolchain@nightly
- uses: dtolnay/[email protected] # MSRV
- uses: taiki-e/install-action@v2
with:
tool: cargo-hack
- run: cargo +nightly hack generate-lockfile --remove-dev-deps -Z direct-minimal-versions
- name: Build (nightly)
run: cargo +nightly build --verbose --all-features
- name: Build (MSRV)
run: cargo build --verbose --features arbitrary,quickcheck,serde,rayon

# One job that "summarizes" the success state of this pipeline. This can then be added to branch
# protection, rather than having to add each job separately.
success:
name: Success
runs-on: ubuntu-latest
needs: [tests, nostd_build, clippy, miri, minimal-versions]
# Github branch protection is exceedingly silly and treats "jobs skipped because a dependency
# failed" as success. So we have to do some contortions to ensure the job fails if any of its
# dependencies fails.
if: always() # make sure this is never "skipped"
steps:
# Manually check the status of all dependencies. `if: failure()` does not work.
- name: check if any dependency failed
run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
2 changes: 1 addition & 1 deletion .rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
edition = "2018"
edition = "2021"
66 changes: 28 additions & 38 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,75 +1,65 @@
[package]
name = "indexmap"
edition = "2018"
version = "1.6.1"
authors = [
"bluss",
"Josh Stone <[email protected]>"
]
edition = "2021"
version = "2.6.0"
documentation = "https://docs.rs/indexmap/"
repository = "https://github.com/bluss/indexmap"
license = "Apache-2.0/MIT"
description = """
A hash table with consistent order and fast iteration.

The indexmap is a hash table where the iteration order of the key-value
pairs is independent of the hash values of the keys. It has the usual
hash table functionality, it preserves insertion order except after
removals, and it allows lookup of its elements by either hash table key
or numerical index. A corresponding hash set type is also provided.

This crate was initially published under the name ordermap, but it was renamed to
indexmap.
"""

repository = "https://github.com/indexmap-rs/indexmap"
license = "Apache-2.0 OR MIT"
description = "A hash table with consistent order and fast iteration."
keywords = ["hashmap", "no_std"]
categories = ["data-structures", "no-std"]

build = "build.rs"
rust-version = "1.63"

[lib]
bench = false

[build-dependencies]
autocfg = "1"
[dependencies]
equivalent = { version = "1.0", default-features = false }

arbitrary = { version = "1.0", optional = true, default-features = false }
quickcheck = { version = "1.0", optional = true, default-features = false }
serde = { version = "1.0", optional = true, default-features = false }
rayon = { version = "1.0", optional = true }
borsh = { version = "1.2", optional = true, default-features = false }
rayon = { version = "1.9", optional = true }

# Internal feature, only used when building as part of rustc,
# not part of the stable interface of this crate.
rustc-rayon = { package = "rustc-rayon", version = "0.5", optional = true }

[dependencies.hashbrown]
version = "0.9.1"
version = "0.15.0"
default-features = false
features = ["raw"]

[dev-dependencies]
itertools = "0.9"
rand = {version = "0.7", features = ["small_rng"] }
quickcheck = { version = "0.9", default-features = false }
itertools = "0.13"
rand = {version = "0.8", features = ["small_rng"] }
quickcheck = { version = "1.0", default-features = false }
fnv = "1.0"
lazy_static = "1.3"
fxhash = "0.2.1"
serde_derive = "1.0"

[features]
# Serialization with serde 1.0
serde-1 = ["serde"]

# Force the use of `std`, bypassing target detection.
default = ["std"]
std = []

# for testing only, of course
test_low_transition_point = []
test_debug = []

[profile.bench]
debug = true

[package.metadata.release]
no-dev-version = true
allow-branch = ["master"]
sign-tag = true
tag-name = "{{version}}"

[package.metadata.docs.rs]
features = ["serde-1", "rayon"]
features = ["arbitrary", "quickcheck", "serde", "borsh", "rayon"]
rustdoc-args = ["--cfg", "docsrs"]

[workspace]
members = ["test-nostd", "test-serde"]

[lints.clippy]
style = "allow"
59 changes: 59 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# indexmap

[![build status](https://github.com/indexmap-rs/indexmap/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/indexmap-rs/indexmap/actions)
[![crates.io](https://img.shields.io/crates/v/indexmap.svg)](https://crates.io/crates/indexmap)
[![docs](https://docs.rs/indexmap/badge.svg)](https://docs.rs/indexmap)
[![rustc](https://img.shields.io/badge/rust-1.63%2B-orange.svg)](https://img.shields.io/badge/rust-1.63%2B-orange.svg)

A pure-Rust hash table which preserves (in a limited sense) insertion order.

This crate implements compact map and set data-structures,
where the iteration order of the keys is independent from their hash or
value. It preserves insertion order (except after removals), and it
allows lookup of entries by either hash table key or numerical index.

Note: this crate was originally released under the name `ordermap`,
but it was renamed to `indexmap` to better reflect its features.
The [`ordermap`](https://crates.io/crates/ordermap) crate now exists
as a wrapper over `indexmap` with stronger ordering properties.

# Background

This was inspired by Python 3.6's new dict implementation (which remembers
the insertion order and is fast to iterate, and is compact in memory).

Some of those features were translated to Rust, and some were not. The result
was indexmap, a hash table that has following properties:

- Order is **independent of hash function** and hash values of keys.
- Fast to iterate.
- Indexed in compact space.
- Preserves insertion order **as long** as you don't call `.remove()`,
`.swap_remove()`, or other methods that explicitly change order.
The alternate `.shift_remove()` does preserve relative order.
- Uses hashbrown for the inner table, just like Rust's libstd `HashMap` does.

## Performance

`IndexMap` derives a couple of performance facts directly from how it is constructed,
which is roughly:

> A raw hash table of key-value indices, and a vector of key-value pairs.

- Iteration is very fast since it is on the dense key-values.
- Removal is fast since it moves memory areas only in the table,
and uses a single swap in the vector.
- Lookup is fast-ish because the initial 7-bit hash lookup uses SIMD, and indices are
densely stored. Lookup also is slow-ish since the actual key-value pairs are stored
separately. (Visible when cpu caches size is limiting.)

- In practice, `IndexMap` has been tested out as the hashmap in rustc in [PR45282] and
the performance was roughly on par across the whole workload.
- If you want the properties of `IndexMap`, or its strongest performance points
fits your workload, it might be the best hash table implementation.

[PR45282]: https://github.com/rust-lang/rust/pull/45282

# Recent Changes

See [RELEASES.md](https://github.com/indexmap-rs/indexmap/blob/master/RELEASES.md).
Loading