fix(cosmic-config): in Config::get_entry, do not push to errors vec if config is NotFound
This commit is contained in:
parent
a29ab33d66
commit
d77e99fb15
1 changed files with 6 additions and 4 deletions
|
|
@ -100,16 +100,18 @@ fn impl_cosmic_config_entry_macro(ast: &syn::DeriveInput) -> TokenStream {
|
||||||
Ok(value) => {
|
Ok(value) => {
|
||||||
default.#field_name = value.into();
|
default.#field_name = value.into();
|
||||||
}
|
}
|
||||||
Err(why) if matches!(why, cosmic_config::Error::NoConfigDirectory) => (),
|
Err(why) => if why.is_err() {
|
||||||
Err(e) => errors.push(e),
|
errors.push(why);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
quote! {
|
quote! {
|
||||||
match cosmic_config::ConfigGet::get::<#field_type>(config, stringify!(#field_name)) {
|
match cosmic_config::ConfigGet::get::<#field_type>(config, stringify!(#field_name)) {
|
||||||
Ok(#field_name) => default.#field_name = #field_name,
|
Ok(#field_name) => default.#field_name = #field_name,
|
||||||
Err(why) if matches!(why, cosmic_config::Error::NoConfigDirectory) => (),
|
Err(why) => if why.is_err() {
|
||||||
Err(e) => errors.push(e),
|
errors.push(why);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue