Repository: tokio-rs/axum
File: axum-macros/src/debug_handler.rs (Rust)

Code before:

            let call_check_fn = format_ident!(
                "__axum_macros_check_{}_{}_from_request_call_check",
                item_fn.sig.ident,
                idx,
                span = span,
            );

            let call_check_fn_body = if takes_self {
                quote_spanned! {span=>
                    Self::#check_fn();
                }
            } else {
                quote_spanned! {span=>
                    #check_fn();
                }
            };

            let check_fn_generics = if must_impl_from_request_parts {
                quote! {}
            } else {
                quote! { <M> }
            };

            let from_request_bound = if must_impl_from_request_parts {
                quote_spanned! { span =>
                    #ty: ::axum::extract::FromRequestParts<#state_ty> + Send
                }
            } else {
                quote_spanned! { span =>
                    #ty: ::axum::extract::FromRequest<#state_ty, #body_ty, M> + Send
                }
            };

            quote_spanned! {span=>
                #[allow(warnings)]
                fn #check_fn #check_fn_generics()
                where
                    #from_request_bound,
                {}

                // we have to call the function to actually trigger a compile error
                // since the function is generic, just defining it is not enough
                #[allow(warnings)]
                fn #call_check_fn()
                {
                    #call_check_fn_body
                }
            }
        })
        .collect::<TokenStream>()

Review comment (suggestion):
In syn's docs, this is always written without any extra spaces, even with the docs pointing out that it should look like that to stand out. I think we should follow that.

```suggestion
                quote_spanned! {span=>
```

Code after:
                    (span, syn::parse_quote!(Self))
                }
                FnArg::Typed(typed) => {
                    let ty = &typed.ty;
                    let span = ty.span();

                    if is_self_pat_type(typed) {
                        (span, syn::parse_quote!(Self))
                    } else {
                        (span, ty.clone())
                    }
                }
            };

            let check_fn = format_ident!(
                "__axum_macros_check_{}_{}_from_request_check",
                item_fn.sig.ident,
                idx,
                span = span,
            );

            let call_check_fn = format_ident!(
                "__axum_macros_check_{}_{}_from_request_call_check",
                item_fn.sig.ident,
                idx,
                span = span,
            );

            let call_check_fn_body = if takes_self {
                quote_spanned! {span=>
                    Self::#check_fn();
                }
            } else {
                quote_spanned! {span=>
                    #check_fn();
                }
            };

            let check_fn_generics = if must_impl_from_request_parts {
                quote! {}
            } else {
                quote! { <M> }
            };

            let from_request_bound = if must_impl_from_request_parts {
                quote_spanned! {span=>
                    #ty: ::axum::extract::FromRequestParts<#state_ty> + Send
                }
            } else {
                quote_spanned! {span=>
                    #ty: ::axum::extract::FromRequest<#state_ty, #body_ty, M> + Send