From a3624e945c3167163bd5a74fbd5a537499a96e6b Mon Sep 17 00:00:00 2001 From: David Beechey Date: Mon, 16 Dec 2024 11:35:06 +0000 Subject: [PATCH] fix formatting/clippy/tests --- boards/stm32f767zi/src/tasks/temperature.rs | 5 ++++- boards/stm32l476rg/src/tasks/temperature.rs | 5 ++++- lib/core/src/format_string.rs | 2 +- lib/sensors/src/temperature.rs | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/boards/stm32f767zi/src/tasks/temperature.rs b/boards/stm32f767zi/src/tasks/temperature.rs index 487a4c9..e362b30 100644 --- a/boards/stm32f767zi/src/tasks/temperature.rs +++ b/boards/stm32f767zi/src/tasks/temperature.rs @@ -4,7 +4,10 @@ use defmt_rtt as _; use embassy_stm32::i2c::I2c; use embassy_stm32::time::Hertz; use embassy_sync::blocking_mutex::Mutex; -use hyped_sensors::{temperature::{Status, Temperature, TemperatureAddresses}, SensorValueRange::*}; +use hyped_sensors::{ + temperature::{Status, Temperature, TemperatureAddresses}, + SensorValueRange::*, +}; /// Test task that just reads the temperature from the sensor and prints it to the console #[embassy_executor::task] diff --git a/boards/stm32l476rg/src/tasks/temperature.rs b/boards/stm32l476rg/src/tasks/temperature.rs index 601c31e..dda2002 100644 --- a/boards/stm32l476rg/src/tasks/temperature.rs +++ b/boards/stm32l476rg/src/tasks/temperature.rs @@ -4,7 +4,10 @@ use defmt_rtt as _; use embassy_stm32::i2c::I2c; use embassy_stm32::time::Hertz; use embassy_sync::blocking_mutex::Mutex; -use hyped_sensors::{temperature::{Status, Temperature, TemperatureAddresses}, SensorValueRange::*}; +use hyped_sensors::{ + temperature::{Status, Temperature, TemperatureAddresses}, + SensorValueRange::*, +}; /// Test task that just reads the temperature from the sensor and prints it to the console #[embassy_executor::task] diff --git a/lib/core/src/format_string.rs b/lib/core/src/format_string.rs index d395845..8392d22 100644 --- a/lib/core/src/format_string.rs +++ b/lib/core/src/format_string.rs @@ -20,7 +20,7 @@ impl<'a> FormatString<'a> { } } -impl<'a> fmt::Write for FormatString<'a> { +impl fmt::Write for FormatString<'_> { fn write_str(&mut self, s: &str) -> fmt::Result { if self.used > self.buffer.len() { return Err(fmt::Error); diff --git a/lib/sensors/src/temperature.rs b/lib/sensors/src/temperature.rs index 729403c..6839f63 100644 --- a/lib/sensors/src/temperature.rs +++ b/lib/sensors/src/temperature.rs @@ -192,7 +192,7 @@ mod tests { let mut i2c = MockI2c::new(&i2c_values); let mut temperature = Temperature::new(&mut i2c, TemperatureAddresses::Address3f, None).unwrap(); - assert_eq!(temperature.read(), Some(SensorValueRange::Warning(0.0))); + assert_eq!(temperature.read(), Some(SensorValueRange::Critical(0.0))); } #[test]