chore: address Rust 1.83.0 clippy lints and enable more clippy lints (#6705)

This commit is contained in:
Sanchith Hegde
2024-12-02 20:00:44 +05:30
committed by GitHub
parent 797a0db773
commit 9a59d0a5ff
139 changed files with 147 additions and 417 deletions

View File

@ -1531,7 +1531,6 @@ pub struct MerchantConnectorUpdate {
#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
#[serde(deny_unknown_fields)]
pub struct ConnectorWalletDetails {
/// This field contains the Apple Pay certificates and credentials for iOS and Web Apple Pay flow
#[serde(skip_serializing_if = "Option::is_none")]

View File

@ -277,7 +277,6 @@ pub struct PaymentIntentFilterValue {
#[derive(Debug, serde::Deserialize, serde::Serialize)]
#[serde(rename_all = "camelCase")]
pub struct GetRefundFilterRequest {
pub time_range: TimeRange,
#[serde(default)]
@ -292,7 +291,6 @@ pub struct RefundFiltersResponse {
#[derive(Debug, serde::Serialize, Eq, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct RefundFilterValue {
pub dimension: RefundDimensions,
pub values: Vec<String>,
@ -435,7 +433,6 @@ pub struct DisputeFiltersResponse {
#[derive(Debug, serde::Serialize, Eq, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct DisputeFilterValue {
pub dimension: DisputeDimensions,
pub values: Vec<String>,

View File

@ -212,7 +212,7 @@ mod never {
{
struct NeverVisitor;
impl<'de> serde::de::Visitor<'de> for NeverVisitor {
impl serde::de::Visitor<'_> for NeverVisitor {
type Value = ();
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {

View File

@ -92,7 +92,6 @@ pub struct ConditionalConfigReq {
pub algorithm: Option<Program<ConditionalConfigs>>,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct DecisionManagerRequest {
pub name: Option<String>,
pub program: Option<Program<ConditionalConfigs>>,

View File

@ -141,7 +141,6 @@ pub enum FrmConnectors {
)]
#[serde(rename_all = "snake_case")]
#[strum(serialize_all = "snake_case")]
pub enum TaxConnectors {
Taxjar,
}

View File

@ -2457,7 +2457,6 @@ pub enum AdditionalPaymentData {
}
#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
pub struct KlarnaSdkPaymentMethod {
pub payment_type: Option<String>,
}
@ -2504,7 +2503,6 @@ pub enum BankRedirectData {
Giropay {
/// The billing details for bank redirection
billing_details: Option<BankRedirectBilling>,
/// Bank account details for Giropay
#[schema(value_type = Option<String>)]
/// Bank account bic code
@ -3682,7 +3680,6 @@ pub enum WalletResponseData {
}
#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct KlarnaSdkPaymentMethodResponse {
pub payment_type: Option<String>,
}
@ -4196,7 +4193,6 @@ pub struct ReceiverDetails {
#[derive(Clone, Debug, PartialEq, serde::Serialize, ToSchema, router_derive::PolymorphicSchema)]
#[generate_schemas(PaymentsCreateResponseOpenApi)]
pub struct PaymentsResponse {
/// Unique identifier for the payment. This ensures idempotency for multiple payments
/// that have been done by a single merchant.
@ -6355,7 +6351,7 @@ mod payment_id_type {
struct PaymentIdVisitor;
struct OptionalPaymentIdVisitor;
impl<'de> Visitor<'de> for PaymentIdVisitor {
impl Visitor<'_> for PaymentIdVisitor {
type Value = PaymentIdType;
fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
@ -6433,7 +6429,7 @@ mod payment_id_type {
struct PaymentIdVisitor;
struct OptionalPaymentIdVisitor;
impl<'de> Visitor<'de> for PaymentIdVisitor {
impl Visitor<'_> for PaymentIdVisitor {
type Value = PaymentIdType;
fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
@ -6507,7 +6503,7 @@ pub mod amount {
// This is defined to provide guarded deserialization of amount
// which itself handles zero and non-zero values internally
impl<'de> de::Visitor<'de> for AmountVisitor {
impl de::Visitor<'_> for AmountVisitor {
type Value = Amount;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
@ -6707,7 +6703,6 @@ pub struct PaymentLinkStatusDetails {
#[derive(Clone, Debug, serde::Deserialize, ToSchema, serde::Serialize)]
#[serde(deny_unknown_fields)]
pub struct PaymentLinkListConstraints {
/// limit on the number of objects to return
pub limit: Option<i64>,

View File

@ -22,7 +22,6 @@ pub struct LinkTokenCreateResponse {
#[derive(Debug, Clone, serde::Deserialize, serde::Serialize)]
#[serde(rename_all = "snake_case")]
pub struct ExchangeTokenCreateRequest {
pub public_token: String,
pub client_secret: Option<String>,

View File

@ -473,7 +473,6 @@ impl RoutingAlgorithmRef {
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ToSchema)]
pub struct RoutingDictionaryRecord {
#[schema(value_type = String)]
pub id: common_utils::id_type::RoutingId,

View File

@ -1,5 +1,4 @@
use common_enums::{AuthenticationType, CountryAlpha2};
use common_utils::{self};
use time::PrimitiveDateTime;
use crate::enums::Connector;