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:
parent
2bad6f36a9
commit
5015459966
@ -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 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user