mirror of
https://github.com/fafhrd91/actix-web
synced 2024-11-28 01:52:57 +01:00
Merge branch 'master' of github.com:actix/actix-web
This commit is contained in:
commit
dcc6efa3e6
@ -184,6 +184,7 @@ impl Route {
|
|||||||
|
|
||||||
pub fn generate(&self) -> TokenStream {
|
pub fn generate(&self) -> TokenStream {
|
||||||
let name = &self.name;
|
let name = &self.name;
|
||||||
|
let resource_name = name.to_string();
|
||||||
let guard = &self.guard;
|
let guard = &self.guard;
|
||||||
let ast = &self.ast;
|
let ast = &self.ast;
|
||||||
let path = &self.args.path;
|
let path = &self.args.path;
|
||||||
@ -196,8 +197,8 @@ impl Route {
|
|||||||
impl actix_web::dev::HttpServiceFactory for #name {
|
impl actix_web::dev::HttpServiceFactory for #name {
|
||||||
fn register(self, config: &mut actix_web::dev::AppService) {
|
fn register(self, config: &mut actix_web::dev::AppService) {
|
||||||
#ast
|
#ast
|
||||||
|
|
||||||
let resource = actix_web::Resource::new(#path)
|
let resource = actix_web::Resource::new(#path)
|
||||||
|
.name(#resource_name)
|
||||||
.guard(actix_web::guard::#guard())
|
.guard(actix_web::guard::#guard())
|
||||||
#(.guard(actix_web::guard::fn_guard(#extra_guards)))*
|
#(.guard(actix_web::guard::fn_guard(#extra_guards)))*
|
||||||
.#resource_type(#name);
|
.#resource_type(#name);
|
||||||
|
Loading…
Reference in New Issue
Block a user