Skip to content

Commit 73aab8d

Browse files
committed
chore: update rand to v0.10
This commit also cleans up the dev-dependencies that were already part of the non-dev dependencies. For Rust 1.64 (the current MSRV) the dependenct resolution for the whole workspace doesn't quite work anymore. Instead of bumping the version, it's solved on the CI level with removing the other workspace members from the Cargo.toml before building. Closes #397.
1 parent 2d00362 commit 73aab8d

File tree

6 files changed

+11
-9
lines changed

6 files changed

+11
-9
lines changed

.github/workflows/build.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,12 @@ jobs:
9494

9595
- uses: Swatinem/rust-cache@v2
9696

97-
- run: cargo +"$MSRV" build --package multihash
97+
# Only the multihash core crate is bound to the MSRV. Currently it's so old that the
98+
# dependency resoluton doesn't quite work. Hence remove all other workspace members.
99+
- name: Build
100+
run: |
101+
sed --in-place '/^members/d' Cargo.toml
102+
cargo +"$MSRV" build --package multihash
98103
99104
coverage:
100105
name: Code Coverage

Cargo.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ serde = ["dep:serde"]
3030
[dependencies]
3131
parity-scale-codec = { version = "3.0.0", default-features = false, features = ["derive"], optional = true }
3232
quickcheck = { version = "1.0.3", optional = true }
33-
rand = { version = "0.9.2", optional = true, features = ["small_rng"] }
33+
rand = { version = "0.10", default-features = false, features = ["alloc"], optional = true }
3434
serde = { version = "1.0.116", optional = true, default-features = false }
3535
unsigned-varint = { version = "0.8.0", default-features = false }
3636
arbitrary = { version = "1.1.0", optional = true }
@@ -40,7 +40,4 @@ core2 = { version = "0.4.0", default-features = false }
4040
[dev-dependencies]
4141
hex = "0.4.2"
4242
serde_json = "1.0.58"
43-
quickcheck = "1.0.3"
44-
rand = "0.9.2"
45-
arbitrary = "1.1.0"
4643
serde_test = "1.0.160"

codetable/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ arbitrary = { version = "1.3.2", optional = true, features = ["derive"] }
4040
hex = "0.4.2"
4141
unsigned-varint = { version = "0.8.0", default-features = false }
4242
criterion = "0.8"
43-
rand = "0.9.2"
43+
rand = { version = "0.10", default-features = false, features = ["thread_rng"] }
4444

4545
[[bench]]
4646
name = "multihash"

codetable/benches/multihash.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::hint::black_box;
22

33
use criterion::{criterion_group, criterion_main, Criterion};
4-
use rand::Rng;
4+
use rand::RngExt;
55

66
use multihash_codetable::{
77
Blake2b256, Blake2b512, Blake2s128, Blake2s256, Blake3_256, Keccak224, Keccak256, Keccak384,

src/arb.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use quickcheck::Gen;
22
use rand::{
33
distr::{weighted::WeightedIndex, Distribution},
4-
Rng, RngCore, SeedableRng,
4+
Rng, RngExt, SeedableRng,
55
};
66

77
use crate::Multihash;

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#[cfg(feature = "alloc")]
2626
extern crate alloc;
2727

28-
#[cfg(any(test, feature = "arb"))]
28+
#[cfg(feature = "arb")]
2929
mod arb;
3030
mod error;
3131
mod multihash;

0 commit comments

Comments
 (0)