Fix: use empty PartialConfig if proj conf missing
If there is no project-specific configuration, use a default one instead. It still needs to be merged with the "[all]" one, assuming that exists. Now to do the same thing for the all-table.
This commit is contained in:
@@ -105,8 +105,10 @@ pub fn get_config(
|
|||||||
// 2. Get table
|
// 2. Get table
|
||||||
|
|
||||||
get_table(cfg_table, project)
|
get_table(cfg_table, project)
|
||||||
// 3. convert to PartialConfig
|
// 3a. convert to PartialConfig
|
||||||
.and_then(PartialConfig::try_from)
|
.and_then(PartialConfig::try_from)
|
||||||
|
// 3b. or default, if the table couldn't be found.
|
||||||
|
.or(Ok(PartialConfig::default()))
|
||||||
// 4. assemble a 2-tuple of PartialConfigs by...
|
// 4. assemble a 2-tuple of PartialConfigs by...
|
||||||
.and_then(|proj| {
|
.and_then(|proj| {
|
||||||
Ok((
|
Ok((
|
||||||
|
|||||||
Reference in New Issue
Block a user