fix(cosmic-config-derive): do not return error when getting config which is not set

This commit is contained in:
Michael Aaron Murphy 2024-03-07 03:57:50 +01:00 committed by Jeremy Soller
parent 422d912634
commit 0ac1c3d7e8

View file

@ -55,6 +55,7 @@ fn impl_cosmic_config_entry_macro(ast: &syn::DeriveInput) -> TokenStream {
quote! {
match cosmic_config::ConfigGet::get::<#field_type>(config, stringify!(#field_name)) {
Ok(#field_name) => default.#field_name = #field_name,
Err(why) if matches!(why, cosmic_config::Error::NoConfigDirectory) => (),
Err(e) => errors.push(e),
}
}