Skip to content

Commit 4471cf3

Browse files
committed
Use syn convenience macro
1 parent 1661006 commit 4471cf3

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

crates/formality-macros/src/test.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
use proc_macro::TokenStream;
2-
use quote::quote;
32

43
pub(crate) fn test(_args: TokenStream, mut item_fn: syn::ItemFn) -> syn::Result<syn::ItemFn> {
54
let original_fn_body = item_fn.block.clone();
6-
item_fn.block = syn::parse2(quote! {
7-
{
8-
formality_core::with_tracing_logs(move || {
9-
#original_fn_body
10-
})
11-
}
12-
})
13-
.unwrap();
5+
item_fn.block = syn::parse_quote!({
6+
formality_core::with_tracing_logs(move || {
7+
#original_fn_body
8+
})
9+
});
1410
Ok(item_fn)
1511
}

0 commit comments

Comments
 (0)