// Remove any custom attributes from function inputs
Remove any custom attributes from function inputs
Remove any custom attributes from function inputs
fn clean_inputs(
    inputs: &Punctuated<FnArg, syn::Token![,]>,
) -> Result<Punctuated<FnArg, syn::Token![,]>, TokenStream> {
    let mut cleaned: Punctuated<FnArg, syn::Token![,]> = inputs.clone();
    for mut pair in cleaned.pairs_mut() {
        let value = pair.value_mut();
        match value {
            FnArg::Receiver(_) => {
                return Err(syn::Error::new_spanned(
                    value,
                    "Routing macro does not allow for self referencing functions",
                )
                .to_compile_error())
            }
            FnArg::Typed(PatType { attrs, .. }) => {
                *attrs = attrs.clone().into_iter().partition(is_attr).1;
            }
        }
    }
    Ok(cleaned)
}
fn clean_inputs ( inputs : & Punctuated < FnArg , syn :: Token ! [ ] > , ) -> Result < Punctuated < FnArg , syn :: Token ! [ ] > , TokenStream > { let mut cleaned : Punctuated < FnArg , syn :: Token ! [ ] > = inputs . clone ( ) ; for mut pair in cleaned . pairs_mut ( ) { let value = pair . value_mut ( ) ; match value { FnArg :: Receiver ( _ ) => { return Err ( syn :: Error :: new_spanned ( value , " " , ) . to_compile_error ( ) ) } FnArg :: Typed ( PatType { attrs , .. } ) => { * attrs = attrs . clone ( ) . into_iter ( ) . partition ( is_attr ) . 1 ; } } } Ok ( cleaned ) }
Remove any custom attributes from function inputs
Remove any custom attributes from function inputs
inputs
&Punctuated<FnArg, syn::Token![,]>