Create-and-assign struct to whole.all

Minor refactor to make the "[all]" table read look like the per-project
table reads.
This commit is contained in:
2025-07-17 11:47:18 -05:00
parent fc1e20185e
commit 5ce20adf2e

View File

@@ -56,10 +56,13 @@ fn lconf(text: &str) -> Result<WholeFile> {
// 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(),
};
}
}