From 213e0b4f4a1b2573fa36139d458f8b3be73dc27e Mon Sep 17 00:00:00 2001 From: Robert Garrett Date: Thu, 17 Jul 2025 10:23:00 -0500 Subject: [PATCH] Add partial- and whole- config structs --- src/config.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/config.rs b/src/config.rs index e9106b4..677e49a 100644 --- a/src/config.rs +++ b/src/config.rs @@ -26,6 +26,24 @@ impl core::fmt::Display for Error{ impl std::error::Error for Error {} +#[derive(Debug, Default)] +#[cfg_attr(test, derive(PartialEq))] +struct PartialConfig { + project_path: Option, + gitea_url: Option, + owner: Option, + repo: Option, + token: Option, +} + +#[derive(Debug, Default)] +#[cfg_attr(test, derive(PartialEq))] +struct WholeFile { + all: PartialConfig, + project_overrides: Vec, +} + + /// The outer value must be a Table so we can get the sub-table from it. fn get_table<'outer>(outer: &'outer Table, table_name: impl ToString) -> Result<&'outer Table> { Ok(outer