Replcaed random function.

Signed-off-by: Pavel Kirilin <win10@list.ru>
This commit is contained in:
2023-02-26 03:45:54 +04:00
parent ae76794709
commit 68a6dd5921
2 changed files with 3 additions and 3 deletions

View File

@ -23,7 +23,7 @@ impl Handler for Blyaficator {
.split(',') .split(',')
// choose random strings from BLYA_WORDS // choose random strings from BLYA_WORDS
// and insert them between splitted strings. // and insert them between splitted strings.
.random_itersperse(BLYA_WORDS, &mut rand::thread_rng()) .random_itersperse(BLYA_WORDS, &mut rand::rngs::OsRng)
// Collect it back to vec // Collect it back to vec
.collect::<Vec<_>>() .collect::<Vec<_>>()
// Creating one string with all words concatenated. // Creating one string with all words concatenated.

View File

@ -114,7 +114,7 @@ mod tests {
let randoms = &[4, 5, 6]; let randoms = &[4, 5, 6];
let result = [1, 2, 3] let result = [1, 2, 3]
.into_iter() .into_iter()
.random_itersperse(randoms, &mut rand::thread_rng()) .random_itersperse(randoms, &mut rand::rngs::OsRng)
.collect::<Vec<_>>(); .collect::<Vec<_>>();
for value in [1, 2, 3] { for value in [1, 2, 3] {
@ -128,7 +128,7 @@ mod tests {
let randoms = &[]; let randoms = &[];
let result = [1, 2, 3] let result = [1, 2, 3]
.into_iter() .into_iter()
.random_itersperse(randoms, &mut rand::thread_rng()) .random_itersperse(randoms, &mut rand::rngs::OsRng)
.collect::<Vec<_>>(); .collect::<Vec<_>>();
for value in [1, 2, 3] { for value in [1, 2, 3] {