1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
diff --git a/Cargo.toml b/Cargo.toml
index c95a6f2..d39e98f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -121,7 +121,7 @@ features = ["use-std"]
default-features = false
[dev-dependencies.rand]
-version = "0.9"
+version = "0.8"
features = ["small_rng"]
[dev-dependencies.serde_json]
diff --git a/src/ascii.rs b/src/ascii.rs
index fe93a86..fab8008 100644
--- a/src/ascii.rs
+++ b/src/ascii.rs
@@ -874,8 +874,8 @@ impl<const N: usize> PartialEq<TinyAsciiStr<N>> for alloc::string::String {
#[cfg(test)]
mod test {
use super::*;
- use rand::distr::Distribution;
- use rand::distr::StandardUniform;
+ use rand::distributions::Distribution;
+ use rand::distributions::Standard;
use rand::rngs::SmallRng;
use rand::SeedableRng;
@@ -909,7 +909,7 @@ mod test {
];
fn gen_strings(num_strings: usize, allowed_lengths: &[usize]) -> Vec<String> {
- use rand::seq::IndexedRandom;
+ use rand::seq::SliceRandom;
let mut rng = SmallRng::seed_from_u64(2022);
// Need to do this in 2 steps since the RNG is needed twice
let string_lengths = core::iter::repeat_with(|| *allowed_lengths.choose(&mut rng).unwrap())
@@ -918,7 +918,7 @@ mod test {
string_lengths
.iter()
.map(|len| {
- StandardUniform
+ Standard
.sample_iter(&mut rng)
.filter(|b: &u8| *b > 0 && *b < 0x80)
.take(*len)
|