From 5ce20adf2e824d26a04e81dea9b3920944ee6a39 Mon Sep 17 00:00:00 2001 From: Robert Garrett Date: Thu, 17 Jul 2025 11:47:18 -0500 Subject: [PATCH] Create-and-assign struct to whole.all Minor refactor to make the "[all]" table read look like the per-project table reads. --- src/config.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/config.rs b/src/config.rs index 1d3d63a..d3dc827 100644 --- a/src/config.rs +++ b/src/config.rs @@ -56,10 +56,13 @@ fn lconf(text: &str) -> Result { // Get the global config out of the file if let Some(section_all) = cfg_table.get("all") { if let Some(table_all) = section_all.as_table() { - whole.all.gitea_url = get_maybe_property(&table_all, "gitea_url")?.cloned(); - whole.all.owner = get_maybe_property(&table_all, "owner")?.cloned(); - whole.all.repo = get_maybe_property(&table_all, "repo")?.cloned(); - whole.all.token = get_maybe_property(&table_all, "token")?.cloned(); + whole.all = PartialConfig { + project_path: None, // There is no global project path. That's nonsense. + gitea_url: get_maybe_property(&table_all, "gitea_url")?.cloned(), + owner: get_maybe_property(&table_all, "owner")?.cloned(), + repo: get_maybe_property(&table_all, "repo")?.cloned(), + token: get_maybe_property(&table_all, "token")?.cloned(), + }; } }