Skip to content

Commit 8954e36

Browse files
committed
Auto merge of #141 - cuviper:upgrade-ahash-rand, r=Amanieu
Upgrade ahash and rand This upgrades ahash to 0.3.2 and (dev) rand to 0.7.3. This is a breaking change because ahash is a public dependency for its hasher type, so I also took the liberty of bumping to hashbrown 0.7.0.
2 parents 6f5826e + 704f030 commit 8954e36

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "hashbrown"
3-
version = "0.6.3"
3+
version = "0.7.0"
44
authors = ["Amanieu d'Antras <[email protected]>"]
55
description = "A Rust port of Google's SwissTable hash map"
66
license = "Apache-2.0/MIT"
@@ -14,7 +14,7 @@ build = "build.rs"
1414

1515
[dependencies]
1616
# For the default hasher
17-
ahash = { version = "0.2.11", optional = true, default-features = false }
17+
ahash = { version = "0.3.2", optional = true, default-features = false }
1818

1919
# For external trait impls
2020
rayon = { version = "1.0", optional = true }
@@ -30,7 +30,7 @@ autocfg = "1"
3030

3131
[dev-dependencies]
3232
lazy_static = "1.2"
33-
rand = "0.5.1"
33+
rand = { version = "0.7.3", features = ["small_rng"] }
3434
rayon = "1.0"
3535
rustc-hash = "1.0"
3636
serde_test = "1.0"

src/map.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use core::ops::Index;
1010

1111
/// Default hasher for `HashMap`.
1212
#[cfg(feature = "ahash")]
13-
pub type DefaultHashBuilder = ahash::ABuildHasher;
13+
pub type DefaultHashBuilder = ahash::RandomState;
1414

1515
/// Dummy default hasher for `HashMap`.
1616
#[cfg(not(feature = "ahash"))]

tests/set.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#![cfg(not(miri))] // FIXME: takes too long
22

33
use hashbrown::HashSet;
4-
use rand::{distributions::Alphanumeric, Rng, SeedableRng, XorShiftRng};
4+
use rand::{distributions::Alphanumeric, rngs::SmallRng, Rng, SeedableRng};
55

66
#[test]
77
fn test_hashset_insert_remove() {
@@ -12,8 +12,7 @@ fn test_hashset_insert_remove() {
1212
130, 220, 246, 217, 111, 124, 221, 189, 190, 234, 121, 93, 67, 95, 100, 43,
1313
];
1414

15-
let mut rng: XorShiftRng = SeedableRng::from_seed(seed);
16-
//let mut rng: XorShiftRng = XorShiftRng::new_unseeded();
15+
let rng = &mut SmallRng::from_seed(seed);
1716
let tx: Vec<Vec<char>> = (0..4096)
1817
.map(|_| (rng.sample_iter(&Alphanumeric).take(32).collect()))
1918
.collect();

0 commit comments

Comments
 (0)