We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3a2f01c commit cfa749aCopy full SHA for cfa749a
src/lib.rs
@@ -70,16 +70,16 @@ pub fn context(args: TokenStream, input: TokenStream) -> TokenStream {
70
.into()
71
}
72
syn::ReturnType::Type(_, return_ty) => {
73
- input.block = syn::parse_quote!({
+ input.block.stmts = syn::parse_quote!(
74
let result: #return_ty = async { #body }.await;
75
result.map_err(|err| err.context(format!(#args)).into())
76
- });
+ );
77
78
79
} else {
80
81
(|| #return_ty #body)().map_err(|err| err.context(format!(#args)).into())
82
83
84
85
quote!(#input).into()
0 commit comments