diff --git a/rm-config/src/main_config.rs b/rm-config/src/main_config.rs index 50f85fe..ba9f63b 100644 --- a/rm-config/src/main_config.rs +++ b/rm-config/src/main_config.rs @@ -115,20 +115,25 @@ impl Header { #[derive(Deserialize)] pub struct TorrentsTab { + #[serde(default = "default_headers")] pub headers: Vec
, } +fn default_headers() -> Vec
{ + vec![ + Header::Name, + Header::SizeWhenDone, + Header::Progress, + Header::Eta, + Header::DownloadRate, + Header::UploadRate, + ] +} + impl Default for TorrentsTab { fn default() -> Self { Self { - headers: vec![ - Header::Name, - Header::SizeWhenDone, - Header::Progress, - Header::Eta, - Header::DownloadRate, - Header::UploadRate, - ], + headers: default_headers(), } } }