chore: cargo clippy fix

This commit is contained in:
Denis Benato
2025-10-12 22:34:20 +02:00
parent 1c1daaa6d2
commit b0e1b21e4b
4 changed files with 7 additions and 7 deletions

View File

@@ -57,7 +57,7 @@ impl AsusArmouryAttribute {
fn resolve_i32_value(refreshed: Option<i32>, cached: &AttrValue) -> i32 { fn resolve_i32_value(refreshed: Option<i32>, cached: &AttrValue) -> i32 {
refreshed refreshed
.or_else(|| match cached { .or(match cached {
AttrValue::Integer(i) => Some(*i), AttrValue::Integer(i) => Some(*i),
_ => None, _ => None,
}) })

View File

@@ -743,7 +743,7 @@ impl CtrlTask for CtrlPlatform {
let mut cfg = platform1.config.lock().await; let mut cfg = platform1.config.lock().await;
set_config_or_default( set_config_or_default(
&attrs, &attrs,
&mut *cfg, &mut cfg,
power_plugged > 0, power_plugged > 0,
profile, profile,
) )
@@ -822,7 +822,7 @@ impl CtrlTask for CtrlPlatform {
let attrs = FirmwareAttributes::new(); let attrs = FirmwareAttributes::new();
{ {
let mut cfg = platform3.config.lock().await; 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 if let Err(e) = platform3
.armoury_registry .armoury_registry

View File

@@ -169,7 +169,7 @@ impl AnimeImage {
// first 5 rows for GA401 are always at X = 0 // first 5 rows for GA401 are always at X = 0
return 0; return 0;
} }
(y + 1) / 2 - 3 y.div_ceil(2) - 3
} }
AnimeType::GU604 => { AnimeType::GU604 => {
// first 9 rows start at zero // first 9 rows start at zero
@@ -185,7 +185,7 @@ impl AnimeImage {
return 0; return 0;
} }
// and then their offset grows by one every two rows // 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 // First 5 rows for GA401 are always 33 physical LEDs long
return 33; return 33;
} }
36 - (y + 1) / 2 36 - y.div_ceil(2)
} }
AnimeType::GU604 => { AnimeType::GU604 => {
if y <= 9 { if y <= 9 {

View File

@@ -158,7 +158,7 @@ fn main() -> Result<(), Box<dyn Error>> {
canvas.set_draw_color(Color::RGB(*b, *b, *b)); canvas.set_draw_color(Color::RGB(*b, *b, *b));
let x: i32 = w + x_count as i32 * w 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 0
} else { } else {
w / 2 w / 2