From 75ae283f23e77dd8c849bb596d9d47a24af7d135 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Fri, 11 Mar 2022 15:34:59 -0500 Subject: [PATCH] Update to rand 0.8 Part of general crate updates. --- tests/inst/Cargo.toml | 2 +- tests/inst/src/destructive.rs | 2 +- tests/inst/src/test.rs | 2 +- tests/inst/src/treegen.rs | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/inst/Cargo.toml b/tests/inst/Cargo.toml index 884d314f..3735c1d5 100644 --- a/tests/inst/Cargo.toml +++ b/tests/inst/Cargo.toml @@ -28,7 +28,7 @@ tokio = { version = "1.4.0", features = ["full"] } futures-util = "0.3.1" base64 = "0.12.0" procspawn = "0.8" -rand = "0.7.3" +rand = "0.8" strum = "0.18.0" strum_macros = "0.18.0" openat = "0.1.19" diff --git a/tests/inst/src/destructive.rs b/tests/inst/src/destructive.rs index 6900d391..98e1c687 100644 --- a/tests/inst/src/destructive.rs +++ b/tests/inst/src/destructive.rs @@ -450,7 +450,7 @@ fn impl_transaction_test>( let ms = std::cmp::min(cycle_time_ms.saturating_mul(20), 24 * 60 * 60 * 1000); time::Duration::from_millis(ms) } else { - time::Duration::from_millis(rng.gen_range(0, cycle_time_ms)) + time::Duration::from_millis(rng.gen_range(0..cycle_time_ms)) }; println!( "force-reboot-time={:?} cycle={:?} status:{:?}", diff --git a/tests/inst/src/test.rs b/tests/inst/src/test.rs index 6f7aa258..c18dbd23 100644 --- a/tests/inst/src/test.rs +++ b/tests/inst/src/test.rs @@ -91,7 +91,7 @@ pub(crate) async fn http_server>( ) -> Result> { if let Some(random_delay) = opts.random_delay { let slices = 100u32; - let n: u32 = rand::thread_rng().gen_range(0, slices); + let n: u32 = rand::thread_rng().gen_range(0..slices); std::thread::sleep((random_delay / slices) * n); } if opts.basicauth { diff --git a/tests/inst/src/treegen.rs b/tests/inst/src/treegen.rs index 975db472..2ec4e849 100644 --- a/tests/inst/src/treegen.rs +++ b/tests/inst/src/treegen.rs @@ -62,9 +62,9 @@ pub(crate) fn mutate_one_executable_to( let extra = rand::thread_rng() .sample_iter(&rand::distributions::Alphanumeric) .take(10) - .collect::(); + .collect::>(); destf - .write_all(extra.as_bytes()) + .write_all(&extra) .context("Failed to append extra data")?; Ok(()) }