From c073b640dcb3e0197c012e8114dd31ea2c41fc23 Mon Sep 17 00:00:00 2001 From: RGBCube Date: Mon, 19 May 2025 21:32:08 +0300 Subject: [PATCH] config: fix schema, toml does not have top level lists --- src/config.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/config.rs b/src/config.rs index 0e07031..47de929 100644 --- a/src/config.rs +++ b/src/config.rs @@ -111,7 +111,9 @@ pub struct DaemonConfigLayer { #[derive(Serialize, Deserialize, Default, Debug, Clone, PartialEq, Eq)] #[serde(transparent, default, rename_all = "kebab-case")] -pub struct DaemonConfig(pub Vec); +pub struct DaemonConfig { + config: Vec, +} impl DaemonConfig { pub fn load_from(path: &Path) -> anyhow::Result { @@ -122,9 +124,9 @@ impl DaemonConfig { let config: Self = toml::from_str(&contents).context("failed to parse config file")?; { - let mut priorities = Vec::with_capacity(config.0.len()); + let mut priorities = Vec::with_capacity(config.config.len()); - for layer in &config.0 { + for layer in &config.config { if priorities.contains(&layer.priority) { bail!("each config layer must have a different priority") }