From 68a6dd592169f3f13325963e15f39ab5a3c5323d Mon Sep 17 00:00:00 2001
From: Pavel Kirilin <win10@list.ru>
Date: Sun, 26 Feb 2023 03:45:54 +0400
Subject: [PATCH] Replcaed random function.

Signed-off-by: Pavel Kirilin <win10@list.ru>
---
 src/bot/handlers/fun/blyaficator.rs | 2 +-
 src/utils/inter_join.rs             | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/bot/handlers/fun/blyaficator.rs b/src/bot/handlers/fun/blyaficator.rs
index e6e41cf..24caf62 100644
--- a/src/bot/handlers/fun/blyaficator.rs
+++ b/src/bot/handlers/fun/blyaficator.rs
@@ -23,7 +23,7 @@ impl Handler for Blyaficator {
                     .split(',')
                     // choose random strings from BLYA_WORDS
                     // 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::<Vec<_>>()
                     // Creating one string with all words concatenated.
diff --git a/src/utils/inter_join.rs b/src/utils/inter_join.rs
index 417a88b..4548f33 100644
--- a/src/utils/inter_join.rs
+++ b/src/utils/inter_join.rs
@@ -114,7 +114,7 @@ mod tests {
         let randoms = &[4, 5, 6];
         let result = [1, 2, 3]
             .into_iter()
-            .random_itersperse(randoms, &mut rand::thread_rng())
+            .random_itersperse(randoms, &mut rand::rngs::OsRng)
             .collect::<Vec<_>>();
 
         for value in [1, 2, 3] {
@@ -128,7 +128,7 @@ mod tests {
         let randoms = &[];
         let result = [1, 2, 3]
             .into_iter()
-            .random_itersperse(randoms, &mut rand::thread_rng())
+            .random_itersperse(randoms, &mut rand::rngs::OsRng)
             .collect::<Vec<_>>();
 
         for value in [1, 2, 3] {
-- 
GitLab