From b0e1b21e4bd9948d1872a6aff457e3984590a2b5 Mon Sep 17 00:00:00 2001 From: Denis Benato Date: Sun, 12 Oct 2025 22:34:20 +0200 Subject: [PATCH] chore: cargo clippy fix --- asusd/src/asus_armoury.rs | 2 +- asusd/src/ctrl_platform.rs | 4 ++-- rog-anime/src/image.rs | 6 +++--- simulators/src/simulator.rs | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/asusd/src/asus_armoury.rs b/asusd/src/asus_armoury.rs index 2e03a651..cc74cd32 100644 --- a/asusd/src/asus_armoury.rs +++ b/asusd/src/asus_armoury.rs @@ -57,7 +57,7 @@ impl AsusArmouryAttribute { fn resolve_i32_value(refreshed: Option, cached: &AttrValue) -> i32 { refreshed - .or_else(|| match cached { + .or(match cached { AttrValue::Integer(i) => Some(*i), _ => None, }) diff --git a/asusd/src/ctrl_platform.rs b/asusd/src/ctrl_platform.rs index b5b896ee..65e57c5f 100644 --- a/asusd/src/ctrl_platform.rs +++ b/asusd/src/ctrl_platform.rs @@ -743,7 +743,7 @@ impl CtrlTask for CtrlPlatform { let mut cfg = platform1.config.lock().await; set_config_or_default( &attrs, - &mut *cfg, + &mut cfg, power_plugged > 0, profile, ) @@ -822,7 +822,7 @@ impl CtrlTask for CtrlPlatform { let attrs = FirmwareAttributes::new(); { let mut cfg = platform3.config.lock().await; - set_config_or_default(&attrs, &mut *cfg, power_plugged, profile).await; + set_config_or_default(&attrs, &mut cfg, power_plugged, profile).await; } if let Err(e) = platform3 .armoury_registry diff --git a/rog-anime/src/image.rs b/rog-anime/src/image.rs index 197d2378..fee51da7 100644 --- a/rog-anime/src/image.rs +++ b/rog-anime/src/image.rs @@ -169,7 +169,7 @@ impl AnimeImage { // first 5 rows for GA401 are always at X = 0 return 0; } - (y + 1) / 2 - 3 + y.div_ceil(2) - 3 } AnimeType::GU604 => { // first 9 rows start at zero @@ -185,7 +185,7 @@ impl AnimeImage { return 0; } // and then their offset grows by one every two rows - (y + 1) / 2 - 5 + y.div_ceil(2) - 5 } } } @@ -213,7 +213,7 @@ impl AnimeImage { // First 5 rows for GA401 are always 33 physical LEDs long return 33; } - 36 - (y + 1) / 2 + 36 - y.div_ceil(2) } AnimeType::GU604 => { if y <= 9 { diff --git a/simulators/src/simulator.rs b/simulators/src/simulator.rs index c719ffd9..cbeacf09 100644 --- a/simulators/src/simulator.rs +++ b/simulators/src/simulator.rs @@ -158,7 +158,7 @@ fn main() -> Result<(), Box> { canvas.set_draw_color(Color::RGB(*b, *b, *b)); let x: i32 = w + x_count as i32 * w - - if (y_count + y_offset as usize) % 2 != 0 { + - if !(y_count + y_offset as usize).is_multiple_of(2) { 0 } else { w / 2