Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ value-trait = { version = "0.12" }
beef = { version = "0.5", optional = true }
halfbrown = "0.4"
# ahash known key
once_cell = { version = "1.21", optional = true }
ahash = { version = "0.8", optional = true }

# serde compatibilty
Expand Down Expand Up @@ -73,7 +72,7 @@ value-no-dup-keys = []
# used for enabeling known keys in favour of a slower
# hasher that is not protected against hash collision
# attacks
known-key = ["once_cell", "ahash"]
known-key = ["ahash"]

# use 8 number at once parsing strategy
swar-number-parsing = []
Expand Down
5 changes: 2 additions & 3 deletions src/known_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ use crate::BorrowedValue as Value;
use crate::cow::Cow;
use crate::prelude::*;
use halfbrown::RawEntryMut;
use std::fmt;
use std::hash::BuildHasher;
use std::{fmt, sync::OnceLock};

use ahash::{AHasher, RandomState};
use once_cell::sync::OnceCell;
static NOT_RANDOM: OnceCell<RandomState> = OnceCell::new();
static NOT_RANDOM: OnceLock<RandomState> = OnceLock::new();

/// `AHash` `BuildHasher` that uses a startup initialized random state for known keys
#[derive(Clone)]
Expand Down
Loading