mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-01 10:01:07 +02:00
fix(core): allow !Sync futures to be used with #[command] (#1755)
This commit is contained in:
@@ -100,8 +100,9 @@ fn body_async(function: &ItemFn) -> syn::Result<TokenStream2> {
|
||||
quote! {
|
||||
resolver.respond_async_serialized(async move {
|
||||
let result = $path(#(#args?),*);
|
||||
(&result).async_kind().future(result).await
|
||||
})
|
||||
let kind = (&result).async_kind();
|
||||
kind.future(result).await
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -125,7 +126,8 @@ fn body_blocking(function: &ItemFn) -> syn::Result<TokenStream2> {
|
||||
|
||||
Ok(quote! {
|
||||
let result = $path(#(match #args #match_body),*);
|
||||
(&result).blocking_kind().block(result, resolver);
|
||||
let kind = (&result).blocking_kind();
|
||||
kind.block(result, resolver);
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user