Skip to content

Commit

Permalink
Allow 'clippy::style' warnings in attr codegen.
Browse files Browse the repository at this point in the history
Furthermore, properly forward 'deprecated' items in catcher codegen.
  • Loading branch information
SergioBenitez committed May 4, 2023
1 parent 56cf905 commit c1ead84
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
6 changes: 4 additions & 2 deletions core/codegen/src/attribute/catch/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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>(
Expand Down
2 changes: 1 addition & 1 deletion core/codegen/src/attribute/route/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>(
Expand Down
1 change: 0 additions & 1 deletion core/codegen/src/derive/uri_display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c1ead84

Please sign in to comment.