node: Better default for RandomState

Signed-off-by: Alexis Sellier <self@cloudhead.io>
This commit is contained in:
Alexis Sellier
2022-09-13 10:16:05 +02:00
parent 5e0d4653c7
commit 5c41af060f
+7 -1
View File
@@ -8,12 +8,18 @@ pub type HashMap<K, V> = std::collections::HashMap<K, V, RandomState>;
pub type HashSet<K> = std::collections::HashSet<K, RandomState>;
/// Random hasher state.
#[derive(Default, Clone)]
#[derive(Clone)]
pub struct RandomState {
key1: u64,
key2: u64,
}
impl Default for RandomState {
fn default() -> Self {
Self::new(fastrand::Rng::new())
}
}
impl RandomState {
fn new(rng: fastrand::Rng) -> Self {
Self {