1
0
mirror of https://github.com/pcvolkmer/checkbar.git synced 2025-04-19 11:06:50 +00:00

refactor: replace match with method call

This commit is contained in:
Paul-Christian Volkmer 2024-01-05 03:49:11 +01:00
parent 2bad6f36a9
commit 5015459966

View File

@ -27,13 +27,12 @@ impl Config {
} }
fn get_config_file() -> String { fn get_config_file() -> String {
match env::args().nth(1) { env::args().nth(1).unwrap_or_else(|| {
Some(config_file) => config_file, format!(
None => format!(
"{}/.checkbar.toml", "{}/.checkbar.toml",
dirs::home_dir().unwrap().to_str().unwrap_or("") dirs::home_dir().unwrap().to_str().unwrap_or("")
), )
} })
} }
pub fn read() -> Self { pub fn read() -> Self {