Use Default trait in Config

This commit is contained in:
Ryze 2023-02-11 15:11:30 +03:00
parent b7fe8194a7
commit 8b04b3b28d

View file

@ -26,13 +26,6 @@ const fn cover_art_default() -> bool {
} }
impl Config { impl Config {
pub fn default() -> Self {
Self {
active: active_default(),
cover_art: cover_art_default()
}
}
pub fn from_config_file(logger: &Logger) -> Self { pub fn from_config_file(logger: &Logger) -> Self {
let path = Config::get_config_path(); let path = Config::get_config_path();
logging::info!(logger, "Config path {path}"); logging::info!(logger, "Config path {path}");
@ -84,3 +77,12 @@ impl Config {
"/etc/mpv/".to_owned() "/etc/mpv/".to_owned()
} }
} }
impl Default for Config {
fn default() -> Self {
Self {
active: active_default(),
cover_art: cover_art_default()
}
}
}