From b9ec3247afa1bf943020541bc7ca2f6059c620aa Mon Sep 17 00:00:00 2001 From: Empire Date: Sun, 7 Jan 2024 14:34:45 +0100 Subject: [PATCH] clippy --- rust/src/main.rs | 8 ++++---- rust/src/plant_hal.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/rust/src/main.rs b/rust/src/main.rs index b6456d5..d2bd2f9 100644 --- a/rust/src/main.rs +++ b/rust/src/main.rs @@ -7,7 +7,7 @@ use anyhow::Result; use chrono::{Datelike, Duration, NaiveDateTime, Timelike}; use chrono_tz::Europe::Berlin; use esp_idf_hal::delay::Delay; -use esp_idf_sys::{esp_restart, uxTaskGetStackHighWaterMark, vTaskDelay}; +use esp_idf_sys::{esp_restart, vTaskDelay}; use esp_ota::rollback_and_reboot; use log::error; use once_cell::sync::Lazy; @@ -182,7 +182,7 @@ fn main() -> Result<()> { if board.is_config_reset() { board.general_fault(true); println!("Reset config is pressed, waiting 5s"); - for i in 0..25 { + for _i in 0..25 { board.general_fault(true); Delay::new_default().delay_ms(50); board.general_fault(false); @@ -385,7 +385,7 @@ fn main() -> Result<()> { //TODO update mqtt state here! } - if (STAY_ALIVE.load(std::sync::atomic::Ordering::Relaxed)) { + if STAY_ALIVE.load(std::sync::atomic::Ordering::Relaxed) { drop(board); let reboot_now = Arc::new(AtomicBool::new(false)); let _webserver = httpd(reboot_now.clone()); @@ -394,7 +394,7 @@ fn main() -> Result<()> { 'eachplant: for plant in 0..PLANT_COUNT { let mut state = plantstate[plant]; - if (state.dry && !state.cooldown) { + if state.dry && !state.cooldown { println!("Trying to pump with pump {} now", plant); let plant_config = config.plants[plant]; diff --git a/rust/src/plant_hal.rs b/rust/src/plant_hal.rs index b5eb449..a40b1ad 100644 --- a/rust/src/plant_hal.rs +++ b/rust/src/plant_hal.rs @@ -196,7 +196,7 @@ pub struct PlantCtrlBoard<'a> { impl PlantCtrlBoardInteraction for PlantCtrlBoard<'_> { fn battery_state(&mut self) -> Result { - return Ok(BatteryState::default()); + Ok(BatteryState::default()) } fn is_day(&self) -> bool {