Allow 'clippy::style' warnings in attr codegen.

Furthermore, properly forward 'deprecated' items in catcher codegen.
This commit is contained in:
Sergio Benitez 2023-05-04 14:44:38 -07:00
parent 56cf905c6e
commit c1ead84ec5
3 changed files with 5 additions and 4 deletions

View File

@ -20,6 +20,7 @@ pub fn _catch(
let user_catcher_fn_name = &catch.function.sig.ident;
let vis = &catch.function.vis;
let status_code = Optional(catch.status.map(|s| s.code));
let deprecated = catch.function.attrs.iter().find(|a| a.path().is_ident("deprecated"));
// Determine the number of parameters that will be passed in.
if catch.function.sig.inputs.len() > 2 {
@ -57,11 +58,12 @@ pub fn _catch(
#user_catcher_fn
#[doc(hidden)]
#[allow(non_camel_case_types)]
#[allow(nonstandard_style)]
/// Rocket code generated proxy structure.
#vis struct #user_catcher_fn_name { }
#deprecated #vis struct #user_catcher_fn_name { }
/// Rocket code generated proxy static conversion implementations.
#[allow(nonstandard_style, deprecated, clippy::style)]
impl #user_catcher_fn_name {
fn into_info(self) -> #_catcher::StaticInfo {
fn monomorphized_function<'__r>(

View File

@ -343,7 +343,7 @@ fn codegen_route(route: Route) -> Result<TokenStream> {
#deprecated #vis struct #handler_fn_name { }
/// Rocket code generated proxy static conversion implementations.
#[allow(nonstandard_style, deprecated)]
#[allow(nonstandard_style, deprecated, clippy::style)]
impl #handler_fn_name {
fn into_info(self) -> #_route::StaticInfo {
fn monomorphized_function<'__r>(

View File

@ -110,7 +110,6 @@ pub fn derive_uri_display_query(input: proc_macro::TokenStream) -> TokenStream {
ts
}
#[allow(non_snake_case)]
pub fn derive_uri_display_path(input: proc_macro::TokenStream) -> TokenStream {
let uri_display = DeriveGenerator::build_for(input.clone(), quote!(impl #P_URI_DISPLAY))
.support(Support::TupleStruct | Support::Type | Support::Lifetime)