diff --git a/crates/librqbit/Cargo.toml b/crates/librqbit/Cargo.toml index 5f43844..6fec66f 100644 --- a/crates/librqbit/Cargo.toml +++ b/crates/librqbit/Cargo.toml @@ -76,3 +76,4 @@ futures = {version = "0.3"} tracing-subscriber = "0.3" tokio-test = "0.4" tempfile = "3" +rand = {version = "0.8", features = ["small_rng"]} diff --git a/crates/librqbit/src/tests/test_util.rs b/crates/librqbit/src/tests/test_util.rs index e72780a..aac8af0 100644 --- a/crates/librqbit/src/tests/test_util.rs +++ b/crates/librqbit/src/tests/test_util.rs @@ -1,7 +1,7 @@ use std::{io::Write, path::Path}; use librqbit_core::Id20; -use rand::RngCore; +use rand::{RngCore, SeedableRng}; use tempfile::TempDir; pub fn create_new_file_with_random_content(path: &Path, mut size: usize) { @@ -14,7 +14,7 @@ pub fn create_new_file_with_random_content(path: &Path, mut size: usize) { eprintln!("creating temp file {:?}", path); const BUF_SIZE: usize = 8192 * 16; - let mut rng = rand::rngs::OsRng; + let mut rng = rand::rngs::SmallRng::from_entropy(); let mut write_buf = [0; BUF_SIZE]; while size > 0 { rng.fill_bytes(&mut write_buf[..]);