From 9437cecf875ba46f69027680c114bdf6470dc783 Mon Sep 17 00:00:00 2001 From: Quentin de Quelen Date: Thu, 21 Feb 2019 13:58:41 +0100 Subject: [PATCH] chore: Use Default derive on Config struct --- src/database/config.rs | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/database/config.rs b/src/database/config.rs index 251d5e93b..491cdba93 100644 --- a/src/database/config.rs +++ b/src/database/config.rs @@ -16,7 +16,7 @@ pub struct AccessToken { } -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Default, Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct Config { pub stop_words: Option>, pub ranking_order: Option>, @@ -26,16 +26,6 @@ pub struct Config { } impl Config { - pub(crate) fn default() -> Config { - Config { - stop_words: None, - ranking_order: None, - distinct_field: None, - ranking_rules: None, - access_token: None, - } - } - pub fn update_with(&mut self, new: Config) { if let Some(stop_words) = new.stop_words { self.stop_words = Some(stop_words);