diff --git a/src/config.rs b/src/config.rs index 162c9874e..64eda408d 100644 --- a/src/config.rs +++ b/src/config.rs @@ -131,13 +131,11 @@ fn get_config_paths(filename: &str) -> Vec { #[cfg(target_os = "windows")] fn get_global_config_path() -> Option { - 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"))]