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) }