mirror of
https://gitlab.com/msrd0/gotham-restful.git
synced 2025-02-22 20:52:27 +00:00
async fn and conn are not compatible atm since diesel is completely sync
This commit is contained in:
parent
310d7f79d5
commit
523d01d443
1 changed files with 4 additions and 0 deletions
|
@ -392,6 +392,10 @@ fn expand(method : Method, attrs : TokenStream, item : TokenStream) -> Result<To
|
|||
}
|
||||
if let Some(arg) = args.iter().filter(|arg| (*arg).ty.is_database_conn()).nth(0)
|
||||
{
|
||||
if fun_is_async
|
||||
{
|
||||
return Err(Error::new(arg.span(), "async fn is not supported when database support is required, consider boxing"));
|
||||
}
|
||||
let conn_ty = arg.ty.quote_ty();
|
||||
state_block = quote! {
|
||||
#state_block
|
||||
|
|
Loading…
Add table
Reference in a new issue