Skip to content

Commit 40cc58b

Browse files
authored
Merge pull request #104 from multiformats/dependabot/cargo/rand-0.9
chore(deps): update rand requirement from 0.8 to 0.9
2 parents 87b1d40 + 365315d commit 40cc58b

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ data-encoding-macro = "0.1.9"
2222

2323
[dev-dependencies]
2424
criterion = "0.5"
25-
rand = "0.8"
25+
rand = "0.9"
2626

2727
[[bench]]
2828
name = "multibase"

benches/multibase.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ use rand::Rng;
44
use multibase::{decode, encode, Base};
55

66
fn bench_encode(c: &mut Criterion) {
7-
let mut rng = rand::thread_rng();
8-
let data: Vec<u8> = (0..1024).map(|_| rng.gen()).collect();
7+
let mut rng = rand::rng();
8+
let data: Vec<u8> = (0..1024).map(|_| rng.random()).collect();
99

1010
let mut group = c.benchmark_group("encode");
1111
group.bench_function("base32", |b| {
@@ -27,8 +27,8 @@ fn bench_encode(c: &mut Criterion) {
2727
}
2828

2929
fn bench_decode(c: &mut Criterion) {
30-
let mut rng = rand::thread_rng();
31-
let data: Vec<usize> = (0..1024).map(|_| rng.gen()).collect();
30+
let mut rng = rand::rng();
31+
let data: Vec<usize> = (0..1024).map(|_| rng.random::<u32>() as usize).collect();
3232

3333
let base32 = b"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";
3434
let base58 = b"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";

0 commit comments

Comments
 (0)