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 =
|
||||
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");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user