Use Default trait in Config
This commit is contained in:
parent
b7fe8194a7
commit
8b04b3b28d
1 changed files with 9 additions and 7 deletions
|
@ -26,13 +26,6 @@ const fn cover_art_default() -> bool {
|
|||
}
|
||||
|
||||
impl Config {
|
||||
pub fn default() -> Self {
|
||||
Self {
|
||||
active: active_default(),
|
||||
cover_art: cover_art_default()
|
||||
}
|
||||
}
|
||||
|
||||
pub fn from_config_file(logger: &Logger) -> Self {
|
||||
let path = Config::get_config_path();
|
||||
logging::info!(logger, "Config path {path}");
|
||||
|
@ -84,3 +77,12 @@ impl Config {
|
|||
"/etc/mpv/".to_owned()
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for Config {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
active: active_default(),
|
||||
cover_art: cover_art_default()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue