Clippy run

This commit is contained in:
Luke D. Jones
2022-09-30 15:10:56 +13:00
parent 8569edf684
commit 600d0ae3d9
39 changed files with 252 additions and 251 deletions

View File

@@ -45,7 +45,7 @@ pub fn print_versions() {
pub const SHOWING_GUI: u8 = 1;
pub const SHOW_GUI: u8 = 2;
#[derive(PartialEq, Clone, Copy)]
#[derive(PartialEq, Eq, Clone, Copy)]
pub enum Page {
System,
AuraEffects,

View File

@@ -72,7 +72,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
.map_err(|e| {
println!("{BOARD_NAME}, {e}");
})
.unwrap_or(KeyLayout::ga401_layout());
.unwrap_or_else(|_| KeyLayout::ga401_layout());
// Cheap method to alert to notifications rather than spinning a thread for each
// This is quite different when done in a retained mode app

View File

@@ -114,7 +114,7 @@ pub fn start_notifications(
})
.detach();
let bios_notified1 = bios_notified.clone();
let bios_notified1 = bios_notified;
executor
.spawn(async move {
let conn = zbus::Connection::system().await.unwrap();
@@ -181,9 +181,9 @@ pub fn start_notifications(
.detach();
// LED notif
let last_notif = last_notification.clone();
let last_notif = last_notification;
let aura_notif = aura_notified.clone();
let notifs_enabled1 = notifs_enabled.clone();
let notifs_enabled1 = notifs_enabled;
executor
.spawn(async move {
let conn = zbus::Connection::system().await.unwrap();

View File

@@ -262,6 +262,7 @@ pub struct PageDataStates {
pub error: Option<String>,
}
#[allow(clippy::too_many_arguments)]
impl PageDataStates {
pub fn new(
keyboard_layout: KeyLayout,

View File

@@ -73,10 +73,10 @@ fn aura_power1(
if ui.toggle_value(&mut keyboard, "Keyboard").changed() {
changed = true;
}
if !supported.keyboard_led.multizone_led_mode.is_empty() {
if ui.toggle_value(&mut lightbar, "Lightbar").changed() {
changed = true;
}
if !supported.keyboard_led.multizone_led_mode.is_empty()
&& ui.toggle_value(&mut lightbar, "Lightbar").changed()
{
changed = true;
}
});
ui.horizontal_wrapped(|ui| {

View File

@@ -54,40 +54,38 @@ pub fn rog_bios_group(
.ok();
}
if supported.rog_bios_ctrl.post_sound {
if ui
if supported.rog_bios_ctrl.post_sound
&& ui
.add(egui::Checkbox::new(
&mut states.bios.post_sound,
"POST sound",
))
.changed()
{
dbus.proxies()
.rog_bios()
.set_post_boot_sound(states.bios.post_sound)
.map_err(|err| {
states.error = Some(err.to_string());
})
.ok();
}
{
dbus.proxies()
.rog_bios()
.set_post_boot_sound(states.bios.post_sound)
.map_err(|err| {
states.error = Some(err.to_string());
})
.ok();
}
if supported.rog_bios_ctrl.post_sound {
if ui
if supported.rog_bios_ctrl.post_sound
&& ui
.add(egui::Checkbox::new(
&mut states.bios.panel_overdrive,
"Panel overdrive",
))
.changed()
{
dbus.proxies()
.rog_bios()
.set_panel_od(states.bios.panel_overdrive)
.map_err(|err| {
states.error = Some(err.to_string());
})
.ok();
}
{
dbus.proxies()
.rog_bios()
.set_panel_od(states.bios.panel_overdrive)
.map_err(|err| {
states.error = Some(err.to_string());
})
.ok();
}
if supported.rog_bios_ctrl.gpu_mux {