diff --git a/serial_test_derive/src/lib.rs b/serial_test_derive/src/lib.rs index 4a6440b..ba69ee0 100644 --- a/serial_test_derive/src/lib.rs +++ b/serial_test_derive/src/lib.rs @@ -327,13 +327,8 @@ fn core_setup( kind: &str, ) -> proc_macro2::TokenStream { let fn_ast: SynResult = syn::parse2(input.clone()); - match fn_ast { - Ok(ast) => { - return fn_setup(ast, config, prefix, kind); - } - Err(_) => { - // Assume non-fn, skip - } + if let Ok(ast) = fn_ast { + return fn_setup(ast, config, prefix, kind); }; let mod_ast: SynResult = syn::parse2(input); match mod_ast {