Skip to content

Commit 63f8e06

Browse files
authored
Merge pull request #126 from xacrimon/acrimon/fci
v4 "The maintenance release"
2 parents 277436b + 7a132a2 commit 63f8e06

17 files changed

+32
-261
lines changed

.github/workflows/ci.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ jobs:
2626
i686-unknown-linux-gnu,
2727
aarch64-unknown-linux-gnu,
2828
armv7-linux-androideabi,
29-
powerpc-unknown-linux-gnu,
30-
wasm32-unknown-emscripten
29+
powerpc-unknown-linux-gnu
3130
]
3231
steps:
3332
- uses: actions/checkout@v2

Cargo.toml

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "dashmap"
3-
version = "3.11.10"
3+
version = "4.0.0"
44
authors = ["Acrimon <[email protected]>"]
55
edition = "2018"
66
license = "MIT"
@@ -15,14 +15,11 @@ categories = ["concurrency", "algorithms", "data-structures"]
1515
[features]
1616
default = []
1717
raw-api = []
18-
no_std = ["hashbrown"]
1918

2019
[dependencies]
2120
num_cpus = "1.13.0"
22-
ahash = "0.3.8"
23-
serde = { version = "1.0.114", optional = true, features = ["derive"] }
21+
serde = { version = "1.0.118", optional = true, features = ["derive"] }
2422
cfg-if = "1.0.0"
25-
hashbrown = { version = "0.8.0", optional = true }
2623
rayon = { version = "1.5.0", optional = true }
2724

2825
[package.metadata.docs.rs]

README.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ If you have any suggestions or tips do not hesitate to open an issue or a PR.
2424

2525
## Cargo features
2626

27-
- `no_std` - Enable no_std + alloc support.
28-
2927
- `serde` - Enables serde support.
3028

3129
- `raw-api` - Enables the unstable raw-shard api.
3230

31+
- `rayon` - Enables rayon support.
32+
3333
## Support me
3434

3535
[![Foo](https://c5.patreon.com/external/logo/[email protected])](https://patreon.com/acrimon)
@@ -47,6 +47,9 @@ Do not hesitate to open issues or PR's.
4747

4848
I will take a look as soon as I have time for it.
4949

50+
That said I do not get paid (yet) to work on open-source. This means
51+
that my time is limited and my work here comes after my personal life.
52+
5053
## Performance
5154

5255
A comprehensive benchmark suite including DashMap can be found [here](https://github.com/xacrimon/conc-map-bench).

src/iter.rs

+3-19
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,11 @@ use crate::lock::{RwLockReadGuard, RwLockWriteGuard};
44
use crate::t::Map;
55
use crate::util::SharedValue;
66
use crate::{DashMap, HashMap};
7-
use ahash::RandomState;
87
use core::hash::{BuildHasher, Hash};
98
use core::mem;
10-
11-
cfg_if::cfg_if! {
12-
if #[cfg(feature = "no_std")] {
13-
use alloc::sync::Arc;
14-
use hashbrown::hash_map;
15-
} else {
16-
use std::sync::Arc;
17-
use std::collections::hash_map;
18-
}
19-
}
9+
use std::collections::hash_map;
10+
use std::collections::hash_map::RandomState;
11+
use std::sync::Arc;
2012

2113
/// Iterator over a DashMap yielding key value pairs.
2214
///
@@ -31,7 +23,6 @@ cfg_if::cfg_if! {
3123
/// let pairs: Vec<(&'static str, &'static str)> = map.into_iter().collect();
3224
/// assert_eq!(pairs.len(), 2);
3325
/// ```
34-
3526
pub struct OwningIter<K, V, S = RandomState> {
3627
map: DashMap<K, V, S>,
3728
shard_i: usize,
@@ -121,7 +112,6 @@ type GuardIterMut<'a, K, V, S> = (
121112
/// map.insert("hello", "world");
122113
/// assert_eq!(map.iter().count(), 1);
123114
/// ```
124-
125115
pub struct Iter<'a, K, V, S = RandomState, M = DashMap<K, V, S>> {
126116
map: &'a M,
127117
shard_i: usize,
@@ -200,7 +190,6 @@ impl<'a, K: Eq + Hash, V, S: 'a + BuildHasher + Clone, M: Map<'a, K, V, S>> Iter
200190
/// map.iter_mut().for_each(|mut r| *r += 1);
201191
/// assert_eq!(*map.get("Johnny").unwrap(), 22);
202192
/// ```
203-
204193
pub struct IterMut<'a, K, V, S = RandomState, M = DashMap<K, V, S>> {
205194
map: &'a M,
206195
shard_i: usize,
@@ -276,13 +265,10 @@ impl<'a, K: Eq + Hash, V, S: 'a + BuildHasher + Clone, M: Map<'a, K, V, S>> Iter
276265
}
277266

278267
#[cfg(test)]
279-
280268
mod tests {
281-
282269
use crate::DashMap;
283270

284271
#[test]
285-
286272
fn iter_mut_manual_count() {
287273
let map = DashMap::new();
288274

@@ -300,7 +286,6 @@ mod tests {
300286
}
301287

302288
#[test]
303-
304289
fn iter_mut_count() {
305290
let map = DashMap::new();
306291

@@ -312,7 +297,6 @@ mod tests {
312297
}
313298

314299
#[test]
315-
316300
fn iter_count() {
317301
let map = DashMap::new();
318302

0 commit comments

Comments
 (0)