diff --git a/Cargo.toml b/Cargo.toml index 8c42f265f6f..b4b8ac4ef6a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -50,7 +50,7 @@ extract_map = { version = "0.1.0", features = ["serde", "iter_mut"] } aformat = "0.1.3" bytes = "1.5.0" # Optional dependencies -fxhash = { version = "0.2.1", optional = true } +foldhash = { version = "0.1.4", optional = true } chrono = { version = "0.4.31", default-features = false, features = ["clock", "serde"], optional = true } flate2 = { version = "1.0.28", optional = true } zstd-safe = { version = "7.2.1", optional = true } @@ -90,7 +90,7 @@ default_no_backend = [ builder = ["tokio/fs"] # Enables the cache, which stores the data received from Discord gateway to provide access to # complete guild data, channels, users and more without needing HTTP requests. -cache = ["fxhash", "dashmap"] +cache = ["foldhash", "dashmap"] # Enables collectors, a utility feature that lets you await interaction events in code with # zero setup, without needing to setup an InteractionCreate event listener. collector = ["gateway"] diff --git a/src/cache/wrappers.rs b/src/cache/wrappers.rs index 8fe87ce931b..d844a7b0812 100644 --- a/src/cache/wrappers.rs +++ b/src/cache/wrappers.rs @@ -83,7 +83,7 @@ impl ReadOnlyMapRef<'_, K, V> { self.0.map_or(0, DashMap::len) } } -pub struct Hasher(fxhash::FxHasher); +pub struct Hasher(foldhash::fast::FoldHasher); impl std::hash::Hasher for Hasher { fn finish(&self) -> u64 { self.0.finish() @@ -98,7 +98,7 @@ impl std::hash::Hasher for Hasher { impl typesize::TypeSize for Hasher {} #[derive(Clone, Default)] -pub struct BuildHasher(fxhash::FxBuildHasher); +pub struct BuildHasher(foldhash::fast::RandomState); impl std::hash::BuildHasher for BuildHasher { type Hasher = Hasher;