Skip to content

Commit cdf9439

Browse files
authored
Switch fxhash dependency with rustc-hash (#3421)
`fxhash` has, for several years, been unmaintained. `rustc-hash` is an alternative offered by the Rust organisation. Fixes #3420
1 parent 6b940c2 commit cdf9439

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ secrecy = { version = "0.8.0", features = ["serde"] }
4242
arrayvec = { version = "0.7.4", features = ["serde"] }
4343
serde_cow = { version = "0.1.0" }
4444
# Optional dependencies
45-
fxhash = { version = "0.2.1", optional = true }
45+
rustc-hash = { version = "2.1.1", optional = true }
4646
simd-json = { version = "0.13.4", optional = true }
4747
uwl = { version = "0.6.0", optional = true }
4848
levenshtein = { version = "1.0.5", optional = true }
@@ -93,7 +93,7 @@ default_no_backend = [
9393
builder = []
9494
# Enables the cache, which stores the data received from Discord gateway to provide access to
9595
# complete guild data, channels, users and more without needing HTTP requests.
96-
cache = ["fxhash", "dashmap", "parking_lot"]
96+
cache = ["rustc-hash", "dashmap", "parking_lot"]
9797
# Enables collectors, a utility feature that lets you await interaction events in code with
9898
# zero setup, without needing to setup an InteractionCreate event listener.
9999
collector = ["gateway", "model"]

src/cache/wrappers.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ impl<K: Eq + Hash, V> ReadOnlyMapRef<'_, K, V> {
8181
self.0.map_or(0, DashMap::len)
8282
}
8383
}
84-
pub struct Hasher(fxhash::FxHasher);
84+
pub struct Hasher(rustc_hash::FxHasher);
8585
impl std::hash::Hasher for Hasher {
8686
fn finish(&self) -> u64 {
8787
self.0.finish()
@@ -92,7 +92,7 @@ impl std::hash::Hasher for Hasher {
9292
}
9393
}
9494
#[derive(Clone, Default)]
95-
pub struct BuildHasher(fxhash::FxBuildHasher);
95+
pub struct BuildHasher(rustc_hash::FxBuildHasher);
9696
impl std::hash::BuildHasher for BuildHasher {
9797
type Hasher = Hasher;
9898

0 commit comments

Comments
 (0)