mirror of
https://gitlab.com/msrd0/gotham-restful.git
synced 2025-02-23 04:52:28 +00:00
fix possible issue with NoContent implicit return and database connection use
This commit is contained in:
parent
e2cf2238fd
commit
f7600977c8
1 changed files with 1 additions and 2 deletions
|
@ -7,7 +7,6 @@ use syn::{
|
||||||
ItemFn,
|
ItemFn,
|
||||||
ReturnType,
|
ReturnType,
|
||||||
Type,
|
Type,
|
||||||
TypePath,
|
|
||||||
parse_macro_input
|
parse_macro_input
|
||||||
};
|
};
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
@ -154,7 +153,7 @@ pub fn expand_method(method : Method, attrs : TokenStream, item : TokenStream) -
|
||||||
use #krate::export::{Future, FromState};
|
use #krate::export::{Future, FromState};
|
||||||
let #repo_ident = <#krate::export::Repo<#conn_ty_real>>::borrow_from(&#state_ident).clone();
|
let #repo_ident = <#krate::export::Repo<#conn_ty_real>>::borrow_from(&#state_ident).clone();
|
||||||
#repo_ident.run::<_, #ret, ()>(move |#conn_ident| {
|
#repo_ident.run::<_, #ret, ()>(move |#conn_ident| {
|
||||||
Ok(#block)
|
Ok({#block})
|
||||||
}).wait().unwrap()
|
}).wait().unwrap()
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue