From c93ab168e42916b9ddaee5ee7407d2347f2202ec Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Mon, 4 Mar 2024 22:11:22 +0100 Subject: [PATCH] fix: handle settings with missing `shared` section This allows configuration files without a `shared` field, using the default value if missing. Before: $ pueued -vv -c /dev/null Error: Error while reading configuration. Caused by: Error while reading configuration: missing field `shared` After: $ pueued -vv -c /dev/null 21:12:26 [INFO] Restoring state 21:12:26 [INFO] Using unix socket at: "/run/user/1000/pueue_rycee.socket" --- CHANGELOG.md | 2 ++ pueue_lib/src/settings.rs | 1 + 2 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ee698c2..24866fb9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - Include priority in `Task`s' `Debug` output +- Fix reading of configuration files that lacks a `shared` section. + ## [3.3.3] - 2024-01-04 ### Fixed diff --git a/pueue_lib/src/settings.rs b/pueue_lib/src/settings.rs index 2f19cf0a..60b5099b 100644 --- a/pueue_lib/src/settings.rs +++ b/pueue_lib/src/settings.rs @@ -194,6 +194,7 @@ pub struct Settings { pub client: Client, #[serde(default = "Default::default")] pub daemon: Daemon, + #[serde(default = "Default::default")] pub shared: Shared, #[serde(default = "HashMap::new")] pub profiles: HashMap,