Fix multiple warnings

This commit is contained in:
Denis Benato
2025-10-08 01:19:38 +02:00
parent daea1f538c
commit 180d63620b
11 changed files with 140 additions and 127 deletions

View File

@@ -1171,9 +1171,9 @@ fn print_firmware_attr(attr: &AsusArmouryProxyBlocking) -> Result<(), Box<dyn st
fn handle_armoury_command(cmd: &ArmouryCommand) -> Result<(), Box<dyn std::error::Error>> {
{
if cmd.free.is_empty() || cmd.free.len() % 2 != 0 || cmd.help {
if cmd.free.is_empty() || !cmd.free.len().is_multiple_of(2) || cmd.help {
const USAGE: &str = "Usage: asusctl platform panel_overdrive 1 nv_dynamic_boost 5";
if cmd.free.len() % 2 != 0 {
if !cmd.free.len().is_multiple_of(2) {
println!(
"Incorrect number of args, each attribute label must be paired with a setting:"
);

View File

@@ -28,7 +28,7 @@ impl Aura {
Ok(())
}
pub async fn lock_config(&self) -> MutexGuard<AuraConfig> {
pub async fn lock_config(&self) -> MutexGuard<'_, AuraConfig> {
self.config.lock().await
}

View File

@@ -20,7 +20,7 @@ impl ScsiAura {
Self { device, config }
}
pub async fn lock_config(&self) -> MutexGuard<ScsiConfig> {
pub async fn lock_config(&self) -> MutexGuard<'_, ScsiConfig> {
self.config.lock().await
}

View File

@@ -27,7 +27,7 @@ impl Slash {
Self { hid, usb, config }
}
pub async fn lock_config(&self) -> MutexGuard<SlashConfig> {
pub async fn lock_config(&self) -> MutexGuard<'_, SlashConfig> {
self.config.lock().await
}

View File

@@ -12,7 +12,7 @@ use slint::{ComponentHandle, Model, ModelRc, SharedString, VecModel};
use super::show_toast;
use crate::config::Config;
use crate::zbus_proxies::find_iface_async;
use crate::{set_ui_callbacks, set_ui_props_async, AttrMinMax, MainWindow, SystemPageData};
use crate::{set_ui_callbacks, AttrMinMax, MainWindow, SystemPageData};
const MINMAX: AttrMinMax = AttrMinMax {
min: 0,
@@ -572,7 +572,7 @@ pub fn setup_system_page_callbacks(ui: &MainWindow, _states: Arc<Mutex<Config>>)
for attr in armoury_attrs {
if let Ok(value) = attr.current_value().await {
let name = attr.name().await.unwrap();
if let Ok(name) = attr.name().await {
debug!("Setting up {} = {value}", <&str>::from(name));
let platform = platform.clone();
handle
@@ -686,6 +686,9 @@ pub fn setup_system_page_callbacks(ui: &MainWindow, _states: Arc<Mutex<Config>>)
FirmwareAttribute::None => {}
})
.ok();
} else {
error!("Attribute with no name, skipping");
}
}
}
handle

View File

@@ -190,7 +190,9 @@ export component MainWindow inherits Window {
y: 0px;
width: root.width;
height: root.height;
padding: 10px;
//padding only has effect on layout elements
//padding: 10px;
background: Palette.background;
border-color: Palette.border;

View File

@@ -37,7 +37,8 @@ export component PageAnime inherits Rectangle {
property <bool> show_builtin_advanced: false;
clip: true;
// TODO: slow with border-radius
padding: 8px;
//padding only has effect on layout elements
//padding: 8px;
// height: parent.height - infobar.height - mainview.padding - self.padding * 2;
// TODO: border-radius: 8px;
VerticalLayout {

View File

@@ -16,7 +16,9 @@ export component PageAppSettings inherits VerticalLayout {
Rectangle {
clip: true;
// TODO: slow with border-radius
padding: 8px;
//padding only has effect on layout elements
//padding: 8px;
// height: parent.height - infobar.height - mainview.padding - self.padding * 2;
// TODO: border-radius: 8px;
mainview := VerticalLayout {

View File

@@ -113,7 +113,8 @@ export component PageAura inherits Rectangle {
min-height: 80px;
max-height: 90px;
RogItem {
padding: 0px;
//padding only has effect on layout elements
//padding: 0px;
VerticalBox {
Text {
text: @tr("Zone");
@@ -136,7 +137,8 @@ export component PageAura inherits Rectangle {
}
RogItem {
padding: 0px;
//padding only has effect on layout elements
//padding: 0px;
VerticalBox {
Text {
text: @tr("Direction");
@@ -158,7 +160,8 @@ export component PageAura inherits Rectangle {
}
RogItem {
padding: 0px;
//padding only has effect on layout elements
//padding: 0px;
VerticalBox {
Text {
text: @tr("Speed");

View File

@@ -140,7 +140,8 @@ export component PageSystem inherits Rectangle {
property <bool> show_fade_cover: false;
property <bool> show_throttle_advanced: false;
clip: true;
padding: 8px;
//padding only has effect on layout elements
//padding: 8px;
ScrollView {
VerticalLayout {
padding: 10px;

View File

@@ -4,7 +4,8 @@
import { Palette, HorizontalBox, VerticalBox } from "std-widgets.slint";
component SideBarItem inherits Rectangle {
padding: 10px;
// padding only has effect on layout elements
// padding: 10px;
in property <bool> selected;
in property <bool> has-focus;
in-out property <string> text <=> label.text;