chore: address Rust 1.78 clippy lints (#4545)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Chethan Rao
2024-05-07 16:05:32 +05:30
committed by GitHub
parent 99bbc3982f
commit 2216a88d25
222 changed files with 1138 additions and 1631 deletions

View File

@ -260,9 +260,9 @@ pub(super) fn get_unused_fields(
ignore: &std::collections::HashSet<String>,
) -> Vec<Field> {
let fields = match fields {
syn::Fields::Unit => Vec::new(),
syn::Fields::Unnamed(_) => Vec::new(),
syn::Fields::Named(fields) => fields.named.iter().cloned().collect(),
Fields::Unit => Vec::new(),
Fields::Unnamed(_) => Vec::new(),
Fields::Named(fields) => fields.named.iter().cloned().collect(),
};
fields
.iter()

View File

@ -58,7 +58,7 @@ pub(super) fn get_struct_fields(
Ok(named.to_owned())
} else {
Err(syn::Error::new(
proc_macro2::Span::call_site(),
Span::call_site(),
"This macro cannot be used on structs with no fields",
))
}

View File

@ -68,7 +68,7 @@ pub fn try_get_enum_variant(
let try_into_fn = syn::Ident::new(
&format!("try_into_{}", variant_name.to_string().to_lowercase()),
proc_macro2::Span::call_site(),
Span::call_site(),
);
Ok(quote::quote! {