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:
@@ -56,10 +56,13 @@ fn lconf(text: &str) -> Result<WholeFile> {
|
|||||||
// Get the global config out of the file
|
// Get the global config out of the file
|
||||||
if let Some(section_all) = cfg_table.get("all") {
|
if let Some(section_all) = cfg_table.get("all") {
|
||||||
if let Some(table_all) = section_all.as_table() {
|
if let Some(table_all) = section_all.as_table() {
|
||||||
whole.all.gitea_url = get_maybe_property(&table_all, "gitea_url")?.cloned();
|
whole.all = PartialConfig {
|
||||||
whole.all.owner = get_maybe_property(&table_all, "owner")?.cloned();
|
project_path: None, // There is no global project path. That's nonsense.
|
||||||
whole.all.repo = get_maybe_property(&table_all, "repo")?.cloned();
|
gitea_url: get_maybe_property(&table_all, "gitea_url")?.cloned(),
|
||||||
whole.all.token = get_maybe_property(&table_all, "token")?.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(),
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user