Replace map types with alloy_primitives::map
#11220
Labels
C-enhancement
New feature or request
D-good-first-issue
Nice and easy! A great choice to get started
Describe the feature
Replace all
{Hash,BTree}{Map,Set}
with their equivalent inalloy_primitives::map
, as explained below. This both improves performance and is more compatible withno_std
, as the fallback will be usinghashbrown
when"std"
is not enabled.Migration guide:
std::collections::{HashMap, HashSet}
->alloy_primitives::map::{HashMap, HashSet}
; unless:Selector
,Address
, orB256
, then usealloy_primitives::map::{<Name>{HashMap,HashSet}}
, e.g.AddressHashMap
B*
orFixedBytes
, then usealloy_primitives::map::{FbHashMap, FbHashSet}
std::collections::{hash_map, hash_set}
->alloy_primitives::map::{hash_map, hash_set}
std::collections::{BTreeMap, BTreeSet}
-> refer to 1. aboveserde::Serialize
, BTree should be replaced with the Index* equivalents so as to have a consistent iteration order, rather than random; this requires the"map-index"
feature.split_off
, then there is nothing to do.The minimum
alloy-primitives
version should also be bumped to0.8.4
.Note that this is rather large in scope, so feel free to open a PR for doing this to a single crate for example.
Additional context
map
module alloy-rs/core#743alloy_primitives::map
alloy-rs/alloy#1365alloy_primitives::map
alloy-rs/trie#41The text was updated successfully, but these errors were encountered: