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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEpqsPES27Eacue91u3d2Q
This commit is contained in:
2 files changed
+9
-8
No files matched your search
@@ -333,10 +333,11 @@ impl App {
|
|||||||
};
|
};
|
||||||
let changed =
|
let changed =
|
||||||
apply_server_icon(bookmark, self.sessions.entry(id).or_default(), address, icon);
|
apply_server_icon(bookmark, self.sessions.entry(id).or_default(), address, icon);
|
||||||
if changed && !self.demo_ui {
|
if changed
|
||||||
if let Err(error) = self.store.update_bookmark(bookmark) {
|
&& !self.demo_ui
|
||||||
warn!(%error, "could not keep the server icon");
|
&& let Err(error) = self.store.update_bookmark(bookmark)
|
||||||
}
|
{
|
||||||
|
warn!(%error, "could not keep the server icon");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -107,10 +107,10 @@ fn talking(input: &TreeInput, client: &ClientInfo) -> bool {
|
|||||||
/// Centered spacer prefixes are presentation metadata, not part of the title.
|
/// Centered spacer prefixes are presentation metadata, not part of the title.
|
||||||
/// Leave other names untouched rather than guessing at the full spacer syntax.
|
/// Leave other names untouched rather than guessing at the full spacer syntax.
|
||||||
fn channel_label(name: &str) -> (&str, bool) {
|
fn channel_label(name: &str) -> (&str, bool) {
|
||||||
if let Some((suffix, label)) = name.strip_prefix("[cspacer").and_then(|s| s.split_once(']')) {
|
if let Some((suffix, label)) = name.strip_prefix("[cspacer").and_then(|s| s.split_once(']'))
|
||||||
if suffix.bytes().all(|b| b.is_ascii_digit()) {
|
&& suffix.bytes().all(|b| b.is_ascii_digit())
|
||||||
return (label, true);
|
{
|
||||||
}
|
return (label, true);
|
||||||
}
|
}
|
||||||
(name, false)
|
(name, false)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user