From 6beb2099e44f9695b8210d71e997d1bb284f7520 Mon Sep 17 00:00:00 2001 From: Hunter Bown Date: Sun, 26 Apr 2026 17:12:38 -0500 Subject: [PATCH] style(working_set): collapse nested if-let in expand_mention_home Parity CI's `cargo clippy ... -D warnings` rejects the nested `if let` pattern in `expand_mention_home` under the new clippy::collapsible_if lint (rust-clippy 1.95). Use the chained `if let ... && let ...` form the lint suggests. No behavior change. Co-Authored-By: Claude Opus 4.7 (1M context) --- crates/tui/src/working_set.rs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/crates/tui/src/working_set.rs b/crates/tui/src/working_set.rs index 86ba07db..9cb12ee8 100644 --- a/crates/tui/src/working_set.rs +++ b/crates/tui/src/working_set.rs @@ -120,14 +120,15 @@ impl Clone for Workspace { } fn expand_mention_home(path: &str) -> PathBuf { - if path == "~" { - if let Some(home) = std::env::var_os("HOME") { - return PathBuf::from(home); - } - } else if let Some(rest) = path.strip_prefix("~/") { - if let Some(home) = std::env::var_os("HOME") { - return PathBuf::from(home).join(rest); - } + if path == "~" + && let Some(home) = std::env::var_os("HOME") + { + return PathBuf::from(home); + } + if let Some(rest) = path.strip_prefix("~/") + && let Some(home) = std::env::var_os("HOME") + { + return PathBuf::from(home).join(rest); } PathBuf::from(path) }