Update backend code to Rust Edition 2024
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user