mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-30 01:27:31 +08:00
chore: enable clippy::trivially_copy_pass_by_ref lint and address it (#6724)
This commit is contained in:
@ -124,7 +124,7 @@ enum StructType {
|
||||
impl StructType {
|
||||
/// Generates the fields for temporary structs which consists of the fields that should be
|
||||
/// encrypted/decrypted
|
||||
fn generate_struct_fields(&self, fields: &[(Field, Ident)]) -> Vec<proc_macro2::TokenStream> {
|
||||
fn generate_struct_fields(self, fields: &[(Field, Ident)]) -> Vec<proc_macro2::TokenStream> {
|
||||
fields
|
||||
.iter()
|
||||
.map(|(field, inner_ty)| {
|
||||
@ -162,7 +162,7 @@ impl StructType {
|
||||
|
||||
/// Generates the ToEncryptable trait implementation
|
||||
fn generate_impls(
|
||||
&self,
|
||||
self,
|
||||
gen1: proc_macro2::TokenStream,
|
||||
gen2: proc_macro2::TokenStream,
|
||||
gen3: proc_macro2::TokenStream,
|
||||
@ -177,7 +177,7 @@ impl StructType {
|
||||
let field_ident = &field.ident;
|
||||
let field_ident_string = field_ident.as_ref().map(|s| s.to_string());
|
||||
|
||||
if is_option || *self == Self::Updated {
|
||||
if is_option || self == Self::Updated {
|
||||
quote! { self.#field_ident.map(|s| map.insert(#field_ident_string.to_string(), s)) }
|
||||
} else {
|
||||
quote! { map.insert(#field_ident_string.to_string(), self.#field_ident) }
|
||||
@ -191,7 +191,7 @@ impl StructType {
|
||||
let field_ident = &field.ident;
|
||||
let field_ident_string = field_ident.as_ref().map(|s| s.to_string());
|
||||
|
||||
if is_option || *self == Self::Updated {
|
||||
if is_option || self == Self::Updated {
|
||||
quote! { #field_ident: map.remove(#field_ident_string) }
|
||||
} else {
|
||||
quote! {
|
||||
|
||||
Reference in New Issue
Block a user