Fix rand breaking changes
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

This commit is contained in:
2025-02-03 20:57:49 +01:00
parent 022073f26a
commit f2e4d82f87
3 changed files with 77 additions and 31 deletions

View File

@ -1,14 +1,9 @@
use lazy_regex::regex_find;
use rand::distributions::Alphanumeric;
use rand::Rng;
use rand::distr::{Alphanumeric, SampleString};
/// Generate a random string of a given size
pub fn rand_str(len: usize) -> String {
rand::thread_rng()
.sample_iter(&Alphanumeric)
.map(char::from)
.take(len)
.collect()
Alphanumeric.sample_string(&mut rand::rng(), len)
}
/// Parse environment variables