fix ahash

This commit is contained in:
Acrimon 2020-12-26 00:17:58 +01:00
parent 515ab93842
commit ef374938a5
No known key found for this signature in database
GPG Key ID: FE567F46AFBDF3AE
10 changed files with 11 additions and 20 deletions

View File

@ -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 }

View File

@ -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;

View File

@ -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() {

View File

@ -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;

View File

@ -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};

View File

@ -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};

View File

@ -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};

View File

@ -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;

View File

@ -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> {

View File

@ -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> {