Skip to content

Commit

Permalink
refactor: Use Option::map_or()
Browse files Browse the repository at this point in the history
  • Loading branch information
simonsan committed Jun 30, 2023
1 parent 5fc8b46 commit 21cd5d6
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,11 @@ fn get_config_paths(filename: &str) -> Vec<PathBuf> {

#[cfg(target_os = "windows")]
fn get_global_config_path() -> Option<PathBuf> {
if let Some(program_data) = std::env::var_os("PROGRAMDATA") {
std::env::var_os("PROGRAMDATA").map_or(None, |program_data| {
let mut path = PathBuf::from(program_data);
path.push(r"rustic\config");
Some(path)
} else {
None
}
})
}

#[cfg(any(target_os = "ios", target_arch = "wasm32"))]
Expand Down

0 comments on commit 21cd5d6

Please sign in to comment.