diff --git a/gotham_restful/src/auth.rs b/gotham_restful/src/auth.rs index 323a344..8da3d5e 100644 --- a/gotham_restful/src/auth.rs +++ b/gotham_restful/src/auth.rs @@ -127,7 +127,7 @@ simply add it to your pipeline and request it inside your handler: #[rest_resource(read_all)] struct AuthResource; -#[derive(Debug, Deserialize)] +#[derive(Debug, Deserialize, Clone)] struct AuthData { sub: String, exp: u64 diff --git a/gotham_restful_derive/src/method.rs b/gotham_restful_derive/src/method.rs index 5a74871..27e4ae0 100644 --- a/gotham_restful_derive/src/method.rs +++ b/gotham_restful_derive/src/method.rs @@ -122,14 +122,6 @@ impl MethodArgumentType } } - fn is_auth_status_ref(&self) -> bool - { - match self { - Self::AuthStatusRef(_) => true, - _ => false - } - } - fn quote_ty(&self) -> Option { match self { @@ -275,7 +267,7 @@ pub fn expand_method(method : Method, attrs : TokenStream, item : TokenStream) - // prepare the where clause let mut where_clause = quote!(#resource_ident : #krate::Resource,); - for arg in args.iter().filter(|arg| (*arg).ty.is_auth_status() && !(*arg).ty.is_auth_status_ref()) + for arg in args.iter().filter(|arg| (*arg).ty.is_auth_status()) { let auth_ty = arg.ty.quote_ty(); where_clause = quote!(#where_clause #auth_ty : Clone,);