mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
chore: cargo clippy fix
This commit is contained in:
@@ -57,7 +57,7 @@ impl AsusArmouryAttribute {
|
||||
|
||||
fn resolve_i32_value(refreshed: Option<i32>, cached: &AttrValue) -> i32 {
|
||||
refreshed
|
||||
.or_else(|| match cached {
|
||||
.or(match cached {
|
||||
AttrValue::Integer(i) => Some(*i),
|
||||
_ => None,
|
||||
})
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -158,7 +158,7 @@ fn main() -> Result<(), Box<dyn Error>> {
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user