Update backend code to Rust Edition 2024
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-03-28 19:25:15 +01:00
parent 658b10f5f8
commit 665a04c8a0
24 changed files with 915 additions and 479 deletions

View File

@ -1,5 +1,5 @@
use crate::app_config::{AppConfig, ConsumptionBackend};
use rand::{thread_rng, Rng};
use rand::{Rng, rng};
use std::num::ParseIntError;
use std::path::Path;
@ -49,7 +49,7 @@ pub async fn get_curr_consumption() -> anyhow::Result<EnergyConsumption> {
match backend {
ConsumptionBackend::Constant { value } => Ok(*value),
ConsumptionBackend::Random { min, max } => Ok(thread_rng().gen_range(*min..*max)),
ConsumptionBackend::Random { min, max } => Ok(rng().random_range(*min..*max)),
ConsumptionBackend::File { path } => {
let path = Path::new(path);