diff --git a/crates/backend/src/codegen/fn.rs b/crates/backend/src/codegen/fn.rs index 16cc3e22..095d34bf 100644 --- a/crates/backend/src/codegen/fn.rs +++ b/crates/backend/src/codegen/fn.rs @@ -405,12 +405,10 @@ impl NapiFn { syn::Type::Reference(syn::TypeReference { lifetime: Some(lifetime), .. - }) => { - return Err(Diagnostic::span_error( - lifetime.span(), - "lifetime is not allowed in napi function arguments", - )); - } + }) => Err(Diagnostic::span_error( + lifetime.span(), + "lifetime is not allowed in napi function arguments", + )), syn::Type::Reference(syn::TypeReference { mutability: Some(_), elem, diff --git a/examples/napi/src/function.rs b/examples/napi/src/function.rs index b9d8cb74..f4b46198 100644 --- a/examples/napi/src/function.rs +++ b/examples/napi/src/function.rs @@ -49,7 +49,7 @@ pub fn create_reference_on_function(env: Env, cb: Function<(), ()>) -> Result