diff --git a/core/codegen/src/derive/form_field.rs b/core/codegen/src/derive/form_field.rs index 4ce26036..737af48e 100644 --- a/core/codegen/src/derive/form_field.rs +++ b/core/codegen/src/derive/form_field.rs @@ -392,12 +392,11 @@ pub fn default<'v>(field: Field<'v>) -> Result> { }, (Some(e), None) | (None, Some(e)) => { Ok(Some(quote_spanned!(e.span() => { - let __default: Option<#ty>; - if __opts.strict { - __default = None; + let __default: Option<#ty> = if __opts.strict { + None } else { - __default = #e; - } + #e + }; __default })))