chore: clippy

This commit is contained in:
Vukašin Vojinović 2026-02-19 18:33:47 +01:00 • committed by Michael Murphy
parent 6e022755f1
commit 787c5ed49f
14 changed files with 218 additions and 243 deletions

View file

@ -41,14 +41,14 @@ pub fn import_theme(path: &Path) -> color_eyre::Result<()> {
let mut manager = Manager::default();
if manager.mode().is_dark != is_dark {
if let Err(err) = manager.dark_mode(is_dark) {
return Err(color_eyre::eyre::eyre!(
"Failed to set {} mode: {:?}",
mode_str,
err
));
}
if manager.mode().is_dark != is_dark
&& let Err(err) = manager.dark_mode(is_dark)
{
return Err(color_eyre::eyre::eyre!(
"Failed to set {} mode: {:?}",
mode_str,
err
));
}
manager

View file

@ -536,7 +536,7 @@ impl Page {
Message::Daytime(day_time) => {
self.day_time = day_time;
return Task::none();
},
}
Message::ThemeModeUpdate(mode) => {
let was_dark = self.theme_manager.mode().is_dark;

View file

@ -189,7 +189,7 @@ impl Page {
}
Message::ReplaceApply => {
if let Some((mut binding, ..)) = self.replace_dialog.pop() {
if let Some((binding, ..)) = self.replace_dialog.pop() {
self.add_shortcut(binding, true);
if self.replace_dialog.is_empty() {

View file

@ -846,7 +846,7 @@ impl Page {
)
.collect()
.then(|id| {
if id.get(0).is_some_and(|id| *id == SECURE_INPUT_VPN.clone()) {
if id.first().is_some_and(|id| *id == SECURE_INPUT_VPN.clone()) {
Task::none()
} else {
focus(SECURE_INPUT_VPN.clone())

View file

@ -371,7 +371,7 @@ impl Page {
ssid,
network_type,
_tx,
interface,
_interface,
) => {
if success || matches!(network_type, NetworkType::Open) {
self.connecting.remove(ssid.as_ref());
@ -747,7 +747,10 @@ impl Page {
)
.collect()
.then(|id| {
if id.get(0).is_some_and(|id| *id == SECURE_INPUT_WIFI.clone()) {
if id
.first()
.is_some_and(|id| *id == SECURE_INPUT_WIFI.clone())
{
Task::none()
} else {
focus(SECURE_INPUT_WIFI.clone())