From 9528bf69851d924d9e2cb322cefdb59f72c4c27d Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 4 Oct 2026 16:51:54 +0000 Subject: [PATCH] voelin-ui: collapse the nested ifs clippy refuses `clippy (Windows)` and strict clippy failed on collapsible_if in remember_server_icon and channel_label; let chains instead. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01FEpqsPES27Eacue91u3d2Q --- crates/voelin-ui/src/servers.rs | 9 +++++---- crates/voelin-ui/src/vm/tree.rs | 8 ++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/crates/voelin-ui/src/servers.rs b/crates/voelin-ui/src/servers.rs index 7faddef..e9456b5 100644 --- a/crates/voelin-ui/src/servers.rs +++ b/crates/voelin-ui/src/servers.rs @@ -333,10 +333,11 @@ impl App { }; let changed = apply_server_icon(bookmark, self.sessions.entry(id).or_default(), address, icon); - if changed && !self.demo_ui { - if let Err(error) = self.store.update_bookmark(bookmark) { - warn!(%error, "could not keep the server icon"); - } + if changed + && !self.demo_ui + && let Err(error) = self.store.update_bookmark(bookmark) + { + warn!(%error, "could not keep the server icon"); } } diff --git a/crates/voelin-ui/src/vm/tree.rs b/crates/voelin-ui/src/vm/tree.rs index 5fecf49..b97c97a 100644 --- a/crates/voelin-ui/src/vm/tree.rs +++ b/crates/voelin-ui/src/vm/tree.rs @@ -107,10 +107,10 @@ fn talking(input: &TreeInput, client: &ClientInfo) -> bool { /// Centered spacer prefixes are presentation metadata, not part of the title. /// Leave other names untouched rather than guessing at the full spacer syntax. fn channel_label(name: &str) -> (&str, bool) { - if let Some((suffix, label)) = name.strip_prefix("[cspacer").and_then(|s| s.split_once(']')) { - if suffix.bytes().all(|b| b.is_ascii_digit()) { - return (label, true); - } + if let Some((suffix, label)) = name.strip_prefix("[cspacer").and_then(|s| s.split_once(']')) + && suffix.bytes().all(|b| b.is_ascii_digit()) + { + return (label, true); } (name, false) }