1
0
Fork 0
mirror of https://gitlab.com/msrd0/gotham-restful.git synced 2025-02-22 20:52:27 +00:00

fix possible issue with NoContent implicit return and database connection use

This commit is contained in:
Dominic 2020-01-14 23:48:14 +01:00
parent e2cf2238fd
commit f7600977c8
Signed by: msrd0
GPG key ID: DCC8C247452E98F9

View file

@ -7,7 +7,6 @@ use syn::{
ItemFn,
ReturnType,
Type,
TypePath,
parse_macro_input
};
use std::str::FromStr;
@ -154,7 +153,7 @@ pub fn expand_method(method : Method, attrs : TokenStream, item : TokenStream) -
use #krate::export::{Future, FromState};
let #repo_ident = <#krate::export::Repo<#conn_ty_real>>::borrow_from(&#state_ident).clone();
#repo_ident.run::<_, #ret, ()>(move |#conn_ident| {
Ok(#block)
Ok({#block})
}).wait().unwrap()
};
}