From e95f7715bca396dafa8891d8bb22158fc70692ea Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Mon, 23 Dec 2024 13:20:05 -0600 Subject: [PATCH] enforce fallback no args return type --- stylus-proc/src/macros/public/types.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/stylus-proc/src/macros/public/types.rs b/stylus-proc/src/macros/public/types.rs index 5088166..0367e36 100644 --- a/stylus-proc/src/macros/public/types.rs +++ b/stylus-proc/src/macros/public/types.rs @@ -333,10 +333,9 @@ impl PublicFn { if matches!(self.kind, FnKind::FallbackNoArgs) { return parse_quote! { return Some({ - if let Err(err) = Self::#name(#storage_arg) { - Err(err) - } else { - Ok(Vec::new()) + match Self::#name(#storage_arg) { + Ok(()) => Ok(Vec::new()), + Err(err) => Err(err), } }); };