Skip to content

Commit

Permalink
fix: handle settings with missing shared section
Browse files Browse the repository at this point in the history
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"
  • Loading branch information
rycee committed Mar 4, 2024
1 parent be40e46 commit c93ab16
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions pueue_lib/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, NestedSettings>,
Expand Down

0 comments on commit c93ab16

Please sign in to comment.