From d77e99fb1555e2728297677de61e23ada4d9d09b Mon Sep 17 00:00:00 2001 From: Michael Aaron Murphy Date: Tue, 15 Sep 2026 14:36:17 +0200 Subject: [PATCH] fix(cosmic-config): in `Config::get_entry`, do not push to errors vec if config is `NotFound` --- cosmic-config-derive/src/lib.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cosmic-config-derive/src/lib.rs b/cosmic-config-derive/src/lib.rs index b49cf447..1c9461b8 100644 --- a/cosmic-config-derive/src/lib.rs +++ b/cosmic-config-derive/src/lib.rs @@ -100,16 +100,18 @@ fn impl_cosmic_config_entry_macro(ast: &syn::DeriveInput) -> TokenStream { Ok(value) => { default.#field_name = value.into(); } - Err(why) if matches!(why, cosmic_config::Error::NoConfigDirectory) => (), - Err(e) => errors.push(e), + Err(why) => if why.is_err() { + errors.push(why); + } } } } else { 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), + Err(why) => if why.is_err() { + errors.push(why); + } } } }