From a675cb5754309ba9997fd2344ab0a364688de430 Mon Sep 17 00:00:00 2001 From: mo8it Date: Mon, 14 Oct 2024 15:24:42 +0200 Subject: Replace ahash with foldhash --- src/collections.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/collections.rs') 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 = std::collections::HashSet>; +/// DOS attacks aren't a concern for Rustlings. Therefore, we use `foldhash` with a fixed state. +pub type HashSet = std::collections::HashSet; #[inline] pub fn hash_set_with_capacity(capacity: usize) -> HashSet { - HashSet::with_capacity_and_hasher(capacity, BuildHasherDefault::::default()) + HashSet::with_capacity_and_hasher(capacity, FixedState::default()) } -- cgit v1.2.3