From 314ffd71c963bdd19b15bbbb2283f51aa8f08fe3 Mon Sep 17 00:00:00 2001 From: realaravinth Date: Thu, 13 May 2021 19:29:49 +0530 Subject: [PATCH] docs for path attribute --- actix-web-codegen/src/lib.rs | 1 + actix-web-codegen/src/route.rs | 7 ------- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/actix-web-codegen/src/lib.rs b/actix-web-codegen/src/lib.rs index 336345014..20c9e742c 100644 --- a/actix-web-codegen/src/lib.rs +++ b/actix-web-codegen/src/lib.rs @@ -117,6 +117,7 @@ Creates route handler with `actix_web::guard::", stringify!($variant), "`. # Attributes - `"path"` - Raw literal string with path for which to register handler. +- `path="variable_name"` - Variable name that contains path for which to register handler - `name="resource_name"` - Specifies resource name for the handler. If not set, the function name of handler is used. - `guard="function_name"` - Registers function as guard using `actix_web::guard::fn_guard`. - `wrap="Middleware"` - Registers a resource middleware. diff --git a/actix-web-codegen/src/route.rs b/actix-web-codegen/src/route.rs index fc1260f39..06729c911 100644 --- a/actix-web-codegen/src/route.rs +++ b/actix-web-codegen/src/route.rs @@ -77,9 +77,7 @@ impl TryFrom<&syn::LitStr> for MethodType { } struct Args { - //path: Option, path: Box, - // i_path: Option, resource_name: Option, guards: Vec, wrappers: Vec, @@ -130,11 +128,6 @@ impl Args { } } else if nv.path.is_ident("path") { if let syn::Lit::Str(lit) = nv.lit { - // path = Some(syn::LitStr::new( - // &Ident::new(&lit.value(), Span::call_site()).to_string(), - // Span::call_site(), - // )); - match path { None => { let x = Ident::new(&lit.value(), Span::call_site());