Update Rust crate rand to 0.9.0 #287

Merged
pierre merged 2 commits from renovate/rand-0.x into master 2025-02-03 20:10:57 +00:00
2 changed files with 3 additions and 9 deletions

View File

@ -35,7 +35,7 @@ uuid = { version = "1.11.0", features = ["v4", "serde"] }
lazy-regex = "3.3.0"
thiserror = "2.0.0"
image = "0.25.4"
rand = "0.8.5"
rand = "0.9.0"
bytes = "1.8.0"
tokio = "1.41.1"
futures = "0.3.31"

View File

@ -1,12 +1,6 @@
use rand::distributions::Alphanumeric;
use rand::Rng;
use rand::distr::{Alphanumeric, SampleString};
/// Generate a random string
pub fn rand_str(len: usize) -> String {
let s: String = rand::thread_rng()
.sample_iter(&Alphanumeric)
.take(len)
.map(char::from)
.collect();
s
Alphanumeric.sample_string(&mut rand::rng(), len)
}