Skip to content

Commit

Permalink
Bump genrand to latest version (0.8) (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
jelmer authored Nov 29, 2023
1 parent 2f41f4a commit 7c2dcb6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ license = "MIT/Apache-2.0"
edition = "2018"

[dev-dependencies]
rand = { version = "0.7", features = ["small_rng"] }
rand = { version = "0.8", features = ["small_rng"] }

4 changes: 2 additions & 2 deletions benches/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,15 @@ fn sort_strings(b: &mut Bencher) {
let mut v = Vec::with_capacity(n);
let mut bytes = 0;
for _ in 0..n {
let len = rng.gen_range(0, 60);
let len = rng.gen_range(0..=60);
bytes += len;
let mut s = String::with_capacity(len);
if len == 0 {
v.push(s);
continue;
}
for _ in 0..len {
s.push(rng.gen_range(b'a', b'z') as char);
s.push(rng.gen_range(b'a'..=b'z') as char);
}
v.push(s);
}
Expand Down
4 changes: 2 additions & 2 deletions benches/bench_default.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,15 +141,15 @@ fn sort_strings(b: &mut Bencher) {
let mut v = Vec::with_capacity(n);
let mut bytes = 0;
for _ in 0..n {
let len = rng.gen_range(0, 60);
let len = rng.gen_range(0..=60);
bytes += len;
let mut s = String::with_capacity(len);
if len == 0 {
v.push(s);
continue;
}
for _ in 0..len {
s.push(rng.gen_range(b'a', b'z') as char);
s.push(rng.gen_range(b'a'..=b'z') as char);
}
v.push(s);
}
Expand Down

0 comments on commit 7c2dcb6

Please sign in to comment.