mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-01 19:42:27 +08:00
fix(router_derive): Use #[automatically_derived] for all derivations (#133)
This commit is contained in:
@ -47,8 +47,10 @@ pub(crate) fn api_error_derive_inner(ast: &DeriveInput) -> syn::Result<TokenStre
|
||||
);
|
||||
|
||||
Ok(quote! {
|
||||
#[automatically_derived]
|
||||
impl #impl_generics std::error::Error for #name #ty_generics #where_clause {}
|
||||
|
||||
#[automatically_derived]
|
||||
impl #impl_generics #name #ty_generics #where_clause {
|
||||
#error_type_fn
|
||||
#error_code_fn
|
||||
@ -226,6 +228,7 @@ fn implement_serialize(
|
||||
});
|
||||
}
|
||||
quote! {
|
||||
#[automatically_derived]
|
||||
impl #impl_generics serde::Serialize for #enum_name #ty_generics #where_clause {
|
||||
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
|
||||
where
|
||||
|
||||
@ -20,6 +20,7 @@ pub(crate) fn diesel_enum_derive_inner(ast: &DeriveInput) -> syn::Result<TokenSt
|
||||
#[diesel(postgres_type(name = #type_name))]
|
||||
pub struct #struct_name;
|
||||
|
||||
#[automatically_derived]
|
||||
impl #impl_generics ::diesel::serialize::ToSql<#struct_name, ::diesel::pg::Pg> for #name #ty_generics
|
||||
#where_clause
|
||||
{
|
||||
@ -31,6 +32,7 @@ pub(crate) fn diesel_enum_derive_inner(ast: &DeriveInput) -> syn::Result<TokenSt
|
||||
}
|
||||
}
|
||||
|
||||
#[automatically_derived]
|
||||
impl #impl_generics ::diesel::deserialize::FromSql<#struct_name, ::diesel::pg::Pg> for #name #ty_generics
|
||||
#where_clause
|
||||
{
|
||||
|
||||
@ -50,6 +50,7 @@ impl Derives {
|
||||
) -> TokenStream {
|
||||
let req_type = Conversion::get_req_type(self);
|
||||
quote! {
|
||||
#[automatically_derived]
|
||||
impl<F:Send+Clone> Operation<F,#req_type> for #struct_name {
|
||||
#(#fns)*
|
||||
}
|
||||
@ -63,6 +64,7 @@ impl Derives {
|
||||
) -> TokenStream {
|
||||
let req_type = Conversion::get_req_type(self);
|
||||
quote! {
|
||||
#[automatically_derived]
|
||||
impl<F:Send+Clone> Operation<F,#req_type> for &#struct_name {
|
||||
#(#ref_fns)*
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user