From 8b04b3b28d4d3bf0f7c10c42bd53b001ed67a9f3 Mon Sep 17 00:00:00 2001 From: Ryze Date: Sat, 11 Feb 2023 15:11:30 +0300 Subject: [PATCH] Use Default trait in Config --- src/config.rs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/config.rs b/src/config.rs index 49b3ce5..d8bc885 100644 --- a/src/config.rs +++ b/src/config.rs @@ -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() + } + } +}