Skip to content

Commit

Permalink
fix formatting/clippy/tests
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbeechey committed Dec 16, 2024
1 parent 7414445 commit a3624e9
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
5 changes: 4 additions & 1 deletion boards/stm32f767zi/src/tasks/temperature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
5 changes: 4 additions & 1 deletion boards/stm32l476rg/src/tasks/temperature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion lib/core/src/format_string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion lib/sensors/src/temperature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit a3624e9

Please sign in to comment.