Skip to content

Commit

Permalink
Replace a single-use match with if let
Browse files Browse the repository at this point in the history
  • Loading branch information
palfrey committed Dec 30, 2023
1 parent 67d22ff commit a8d985d
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions serial_test_derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,13 +327,8 @@ fn core_setup(
kind: &str,
) -> proc_macro2::TokenStream {
let fn_ast: SynResult<syn::ItemFn> = 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::ItemMod> = syn::parse2(input);
match mod_ast {
Expand Down

0 comments on commit a8d985d

Please sign in to comment.