mirror of https://github.com/xacrimon/dashmap
fix ahash
This commit is contained in:
parent
515ab93842
commit
ef374938a5
|
@ -19,7 +19,6 @@ no_std = ["hashbrown"]
|
|||
|
||||
[dependencies]
|
||||
num_cpus = "1.13.0"
|
||||
ahash = "0.3.8"
|
||||
serde = { version = "1.0.114", optional = true, features = ["derive"] }
|
||||
cfg-if = "1.0.0"
|
||||
hashbrown = { version = "0.8.0", optional = true }
|
||||
|
|
|
@ -4,7 +4,7 @@ use crate::lock::{RwLockReadGuard, RwLockWriteGuard};
|
|||
use crate::t::Map;
|
||||
use crate::util::SharedValue;
|
||||
use crate::{DashMap, HashMap};
|
||||
use ahash::RandomState;
|
||||
use std::collections::hash_map::RandomState;
|
||||
use core::hash::{BuildHasher, Hash};
|
||||
use core::mem;
|
||||
|
||||
|
|
14
src/lib.rs
14
src/lib.rs
|
@ -19,7 +19,7 @@ pub mod rayon {
|
|||
pub mod set;
|
||||
}
|
||||
|
||||
use ahash::RandomState;
|
||||
use std::collections::hash_map::RandomState;
|
||||
use cfg_if::cfg_if;
|
||||
use core::borrow::Borrow;
|
||||
use core::fmt;
|
||||
|
@ -291,7 +291,7 @@ impl<'a, K: 'a + Eq + Hash, V: 'a, S: BuildHasher + Clone> DashMap<K, V, S> {
|
|||
///
|
||||
/// ```rust
|
||||
/// use dashmap::DashMap;
|
||||
/// use ahash::RandomState;
|
||||
/// use std::collections::hash_map::RandomState;
|
||||
///
|
||||
/// let hasher = RandomState::new();
|
||||
/// let map: DashMap<i32, i32> = DashMap::new();
|
||||
|
@ -919,15 +919,7 @@ impl<K: Eq + Hash, V> FromIterator<(K, V)> for DashMap<K, V, RandomState> {
|
|||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::DashMap;
|
||||
|
||||
cfg_if::cfg_if! {
|
||||
if #[cfg(feature = "no_std")] {
|
||||
use alloc::string::String;
|
||||
use ahash::RandomState;
|
||||
} else {
|
||||
use std::collections::hash_map::RandomState;
|
||||
}
|
||||
}
|
||||
use std::collections::hash_map::RandomState;
|
||||
|
||||
#[test]
|
||||
fn test_basic() {
|
||||
|
|
|
@ -3,7 +3,7 @@ use crate::lock::RwLockWriteGuard;
|
|||
use crate::util;
|
||||
use crate::util::SharedValue;
|
||||
use crate::HashMap;
|
||||
use ahash::RandomState;
|
||||
use std::collections::hash_map::RandomState;
|
||||
use core::hash::{BuildHasher, Hash};
|
||||
use core::mem;
|
||||
use core::ptr;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use crate::lock::{RwLockReadGuard, RwLockWriteGuard};
|
||||
use crate::HashMap;
|
||||
use ahash::RandomState;
|
||||
use std::collections::hash_map::RandomState;
|
||||
use core::hash::BuildHasher;
|
||||
use core::hash::Hash;
|
||||
use core::ops::{Deref, DerefMut};
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use crate::lock::{RwLockReadGuard, RwLockWriteGuard};
|
||||
use crate::HashMap;
|
||||
use ahash::RandomState;
|
||||
use std::collections::hash_map::RandomState;
|
||||
use core::hash::{BuildHasher, Hash};
|
||||
use core::ops::{Deref, DerefMut};
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use crate::t::Map;
|
||||
use crate::{DashMap, HashMap};
|
||||
use ahash::RandomState;
|
||||
use std::collections::hash_map::RandomState;
|
||||
use core::borrow::Borrow;
|
||||
use core::fmt;
|
||||
use core::hash::{BuildHasher, Hash};
|
||||
|
|
|
@ -5,7 +5,7 @@ use crate::setref::one::Ref;
|
|||
use crate::DashMap;
|
||||
#[cfg(feature = "raw-api")]
|
||||
use crate::HashMap;
|
||||
use ahash::RandomState;
|
||||
use std::collections::hash_map::RandomState;
|
||||
use cfg_if::cfg_if;
|
||||
use core::borrow::Borrow;
|
||||
use core::fmt;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use crate::mapref;
|
||||
use ahash::RandomState;
|
||||
use std::collections::hash_map::RandomState;
|
||||
use core::hash::{BuildHasher, Hash};
|
||||
use core::ops::Deref;
|
||||
pub struct RefMulti<'a, K, S = RandomState> {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use crate::mapref;
|
||||
use ahash::RandomState;
|
||||
use std::collections::hash_map::RandomState;
|
||||
use core::hash::{BuildHasher, Hash};
|
||||
use core::ops::Deref;
|
||||
pub struct Ref<'a, K, S = RandomState> {
|
||||
|
|
Loading…
Reference in New Issue