diff options
| author | mo8it <mo8it@proton.me> | 2024-10-14 15:24:42 +0200 |
|---|---|---|
| committer | mo8it <mo8it@proton.me> | 2024-10-14 15:24:42 +0200 |
| commit | a675cb5754309ba9997fd2344ab0a364688de430 (patch) | |
| tree | c596be60995e7625b4a63cd32a7beca8cba4d188 /src/collections.rs | |
| parent | baeeff389c95ba145e3383ec1f1357e078d0bbca (diff) | |
Replace ahash with foldhash
Diffstat (limited to 'src/collections.rs')
| -rw-r--r-- | src/collections.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/collections.rs b/src/collections.rs index fa9e3fa..3f2841e 100644 --- a/src/collections.rs +++ b/src/collections.rs @@ -1,10 +1,9 @@ -use ahash::AHasher; -use std::hash::BuildHasherDefault; +use foldhash::fast::FixedState; -/// DOS attacks aren't a concern for Rustlings. Therefore, we use `ahash` with fixed seeds. -pub type HashSet<T> = std::collections::HashSet<T, BuildHasherDefault<AHasher>>; +/// DOS attacks aren't a concern for Rustlings. Therefore, we use `foldhash` with a fixed state. +pub type HashSet<T> = std::collections::HashSet<T, FixedState>; #[inline] pub fn hash_set_with_capacity<T>(capacity: usize) -> HashSet<T> { - HashSet::with_capacity_and_hasher(capacity, BuildHasherDefault::<AHasher>::default()) + HashSet::with_capacity_and_hasher(capacity, FixedState::default()) } |
