Part of general crate updates.
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"
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:{:?}",
) -> Result<Response<Body>> {
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 {
let extra = rand::thread_rng()
.sample_iter(&rand::distributions::Alphanumeric)
.take(10)
- .collect::<String>();
+ .collect::<Vec<u8>>();
destf
- .write_all(extra.as_bytes())
+ .write_all(&extra)
.context("Failed to append extra data")?;
Ok(())
}