1
0
Fork 0
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:
Dominic 2020-04-18 15:48:00 +02:00
parent 310d7f79d5
commit 523d01d443
Signed by: msrd0
GPG key ID: DCC8C247452E98F9

View file

@ -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