From 6fca5cd9d50ee15aca879876e1986e0c3984534c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Frosteg=C3=A5rd?= Date: Tue, 14 Apr 2020 17:45:35 +0200 Subject: [PATCH] aquatic: config: resort to default values for keys not present in file --- aquatic/src/lib/config.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aquatic/src/lib/config.rs b/aquatic/src/lib/config.rs index 265d63a..d6400bb 100644 --- a/aquatic/src/lib/config.rs +++ b/aquatic/src/lib/config.rs @@ -4,6 +4,7 @@ use serde::{Serialize, Deserialize}; #[derive(Clone, Debug, Serialize, Deserialize)] +#[serde(default)] pub struct Config { /// Socket workers receive requests from the socket, parse them and send /// them on to the request workers. They then recieve responses from the @@ -20,6 +21,7 @@ pub struct Config { #[derive(Clone, Debug, Serialize, Deserialize)] +#[serde(default)] pub struct NetworkConfig { /// Bind to this address pub address: SocketAddr, @@ -36,6 +38,7 @@ pub struct NetworkConfig { #[derive(Clone, Debug, Serialize, Deserialize)] +#[serde(default)] pub struct HandlerConfig { /// Maximum number of requests to receive from channel before locking /// mutex and starting work @@ -45,6 +48,7 @@ pub struct HandlerConfig { #[derive(Clone, Debug, Serialize, Deserialize)] +#[serde(default)] pub struct StatisticsConfig { /// Print statistics this often (seconds). Don't print when set to zero. pub interval: u64, @@ -52,6 +56,7 @@ pub struct StatisticsConfig { #[derive(Clone, Debug, Serialize, Deserialize)] +#[serde(default)] pub struct CleaningConfig { /// Clean torrents and connections this often (seconds) pub interval: u64,