diff options
author | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2020-08-25 16:39:12 +0300 |
---|---|---|
committer | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2020-08-26 00:54:07 +0300 |
commit | 8c6c9806b5bd97142905045fa709d1db3640ac76 (patch) | |
tree | 3b4585abff8bb50cfbe98e748eba90d6f5ece603 /melib/src/lib.rs | |
parent | fc25c7b165951fb277e218c80e4e1c3e67f1e192 (diff) |
Fix some clippy lints
Diffstat (limited to 'melib/src/lib.rs')
-rw-r--r-- | melib/src/lib.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/melib/src/lib.rs b/melib/src/lib.rs index 532aa65d..b2f1b59a 100644 --- a/melib/src/lib.rs +++ b/melib/src/lib.rs @@ -168,16 +168,16 @@ pub mod shellexpand { let c_to_str = c.as_os_str().to_str(); match c_to_str { Some("~") => { - if let Some(home_dir) = std::env::var("HOME").ok() { + if let Ok(home_dir) = std::env::var("HOME") { ret.push(home_dir) } else { return PathBuf::new(); } } - Some(var) if var.starts_with("$") => { + Some(var) if var.starts_with('$') => { let env_name = var.split_at(1).1; if env_name.chars().all(char::is_uppercase) { - ret.push(std::env::var(env_name).unwrap_or(String::new())); + ret.push(std::env::var(env_name).unwrap_or_default()); } else { ret.push(c); } |