From 878510bcb2372fcbc38cdd8cf4c1dce98fd62911 Mon Sep 17 00:00:00 2001 From: mat Date: Sat, 27 Apr 2024 20:41:56 -0500 Subject: [PATCH] make ui and engines optional in config --- src/config.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/config.rs b/src/config.rs index 87887c7..287f03d 100644 --- a/src/config.rs +++ b/src/config.rs @@ -9,11 +9,13 @@ use crate::engines::Engine; #[derive(Deserialize, Debug)] pub struct Config { pub bind: SocketAddr, + #[serde(default)] pub ui: UiConfig, + #[serde(default)] pub engines: EnginesConfig, } -#[derive(Deserialize, Debug)] +#[derive(Deserialize, Debug, Default)] pub struct UiConfig { #[serde(default)] pub show_engine_list_separator: Option, @@ -21,7 +23,7 @@ pub struct UiConfig { pub show_version_info: Option, } -#[derive(Deserialize, Debug)] +#[derive(Deserialize, Debug, Default)] pub struct EnginesConfig { #[serde(flatten)] pub map: HashMap,