diff options
Diffstat (limited to 'src/util/unix.rs')
-rw-r--r-- | src/util/unix.rs | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/util/unix.rs b/src/util/unix.rs index 5e05473..ac66e2b 100644 --- a/src/util/unix.rs +++ b/src/util/unix.rs @@ -60,10 +60,7 @@ pub fn expand_shell_string(s: &str) -> path::PathBuf { let dir = dirs_next::home_dir(); let os_str = dir.map(|s| s.as_os_str().to_owned()); let context_func = || { - let cow_str = match os_str.as_ref() { - Some(s) => Some(s.to_string_lossy()), - None => None, - }; + let cow_str = os_str.as_ref().map(|s| s.to_string_lossy()); cow_str }; let tilde_cow = shellexpand::tilde_with_context(s, context_func); |