Use defaultconfig instead of default on structs

This commit is contained in:
Philip Kristoffersen
2021-09-25 12:19:07 +02:00
parent 993251156d
commit f68db38a7f
6 changed files with 30 additions and 69 deletions
-20
View File
@@ -6,24 +6,4 @@ pub struct EpicGamesLauncherSettings {
pub location: Option<String>,
}
impl Default for EpicGamesLauncherSettings {
fn default() -> Self {
// On windows
// Even if no path is given, we can try to guess, so lets enable by default
#[cfg(target_os = "windows")]
let enabled = true;
// On linux
// We can not guess, so lets not enable by default
#[cfg(target_os = "linux")]
let enabled = false;
EpicGamesLauncherSettings {
enabled,
location: None,
}
}
}