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

chore(deps): bump hashbrown to 0.15 #753

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ tiny-keccak = { version = "2.0", default-features = false }
sha3 = { version = "0.10.8", default-features = false }

# maps
hashbrown = { version = "0.14", default-features = false }
hashbrown = { version = "0.15", default-features = false }
indexmap = { version = "2.5", default-features = false }
rustc-hash = { version = "2.0", default-features = false }

Expand Down
2 changes: 1 addition & 1 deletion crates/primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ k256 = { workspace = true, optional = true, features = ["ecdsa"] }

# map
hashbrown = { workspace = true, optional = true, features = [
"ahash",
"default-hasher",
"inline-more",
] }
indexmap = { workspace = true, optional = true }
Expand Down
12 changes: 11 additions & 1 deletion crates/primitives/src/map/fixed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,22 @@ impl<const N: usize> BuildHasher for FbBuildHasher<N> {
/// Works best with `fxhash`, enabled by default with the "map-fxhash" feature.
///
/// **NOTE:** this hasher accepts only `N`-length byte arrays! It is invalid to hash anything else.
#[derive(Clone, Default)]
#[derive(Clone)]
pub struct FbHasher<const N: usize> {
inner: DefaultHasher,
_marker: core::marker::PhantomData<[(); N]>,
}

impl<const N: usize> Default for FbHasher<N> {
#[inline]
fn default() -> Self {
Self {
inner: DefaultHashBuilder::default().build_hasher(),
_marker: core::marker::PhantomData,
}
}
}

impl<const N: usize> fmt::Debug for FbHasher<N> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("FbHasher").finish_non_exhaustive()
Expand Down
2 changes: 1 addition & 1 deletion crates/primitives/src/map/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ cfg_if! {
if #[cfg(feature = "map-fxhash")] {
type DefaultHashBuilderInner = FxBuildHasher;
} else if #[cfg(any(feature = "map-hashbrown", not(feature = "std")))] {
type DefaultHashBuilderInner = hashbrown::hash_map::DefaultHashBuilder;
type DefaultHashBuilderInner = hashbrown::DefaultHashBuilder;
} else {
type DefaultHashBuilderInner = std::collections::hash_map::RandomState;
}
Expand Down
1 change: 1 addition & 0 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ allow = [
"Unicode-DFS-2016",
"Unlicense",
"MPL-2.0",
"Zlib",
# https://github.com/briansmith/ring/issues/902
"LicenseRef-ring",
# https://github.com/briansmith/webpki/issues/148
Expand Down