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

@ -74,7 +74,7 @@ pub async fn payments_incoming_webhook_flow<Ctx: PaymentMethodRetrieve>(
payments::CallConnectorAction::Trigger
};
let payments_response = match webhook_details.object_reference_id {
api_models::webhooks::ObjectReferenceId::PaymentId(id) => {
webhooks::ObjectReferenceId::PaymentId(id) => {
let payment_id = get_payment_id(
state.store.as_ref(),
&id,
@ -84,7 +84,7 @@ pub async fn payments_incoming_webhook_flow<Ctx: PaymentMethodRetrieve>(
.await?;
let lock_action = api_locking::LockAction::Hold {
input: super::api_locking::LockingInput {
input: api_locking::LockingInput {
unique_locking_key: payment_id,
api_identifier: lock_utils::ApiIdentifier::Payments,
override_lock_retries: None,
@ -213,13 +213,13 @@ pub async fn refunds_incoming_webhook_flow(
webhook_details: api::IncomingWebhookDetails,
connector_name: &str,
source_verified: bool,
event_type: api_models::webhooks::IncomingWebhookEvent,
event_type: webhooks::IncomingWebhookEvent,
) -> CustomResult<WebhookResponseTracker, errors::ApiErrorResponse> {
let db = &*state.store;
//find refund by connector refund id
let refund = match webhook_details.object_reference_id {
api_models::webhooks::ObjectReferenceId::RefundId(refund_id_type) => match refund_id_type {
api_models::webhooks::RefundIdType::RefundId(id) => db
webhooks::ObjectReferenceId::RefundId(refund_id_type) => match refund_id_type {
webhooks::RefundIdType::RefundId(id) => db
.find_refund_by_merchant_id_refund_id(
&merchant_account.merchant_id,
&id,
@ -228,7 +228,7 @@ pub async fn refunds_incoming_webhook_flow(
.await
.change_context(errors::ApiErrorResponse::WebhookResourceNotFound)
.attach_printable("Failed to fetch the refund")?,
api_models::webhooks::RefundIdType::ConnectorRefundId(id) => db
webhooks::RefundIdType::ConnectorRefundId(id) => db
.find_refund_by_merchant_id_connector_refund_id_connector(
&merchant_account.merchant_id,
&id,
@ -305,7 +305,7 @@ pub async fn refunds_incoming_webhook_flow(
pub async fn get_payment_attempt_from_object_reference_id(
state: &AppState,
object_reference_id: api_models::webhooks::ObjectReferenceId,
object_reference_id: webhooks::ObjectReferenceId,
merchant_account: &domain::MerchantAccount,
) -> CustomResult<
hyperswitch_domain_models::payments::payment_attempt::PaymentAttempt,
@ -349,7 +349,7 @@ pub async fn get_or_update_dispute_object(
dispute_details: api::disputes::DisputePayload,
merchant_id: &str,
payment_attempt: &hyperswitch_domain_models::payments::payment_attempt::PaymentAttempt,
event_type: api_models::webhooks::IncomingWebhookEvent,
event_type: webhooks::IncomingWebhookEvent,
business_profile: &diesel_models::business_profile::BusinessProfile,
connector_name: &str,
) -> CustomResult<diesel_models::dispute::Dispute, errors::ApiErrorResponse> {
@ -425,7 +425,7 @@ pub async fn external_authentication_incoming_webhook_flow<Ctx: PaymentMethodRet
merchant_account: domain::MerchantAccount,
key_store: domain::MerchantKeyStore,
source_verified: bool,
event_type: api_models::webhooks::IncomingWebhookEvent,
event_type: webhooks::IncomingWebhookEvent,
request_details: &api::IncomingWebhookRequestDetails<'_>,
connector: &(dyn api::Connector + Sync),
object_ref_id: api::ObjectReferenceId,
@ -601,7 +601,7 @@ pub async fn mandates_incoming_webhook_flow(
key_store: domain::MerchantKeyStore,
webhook_details: api::IncomingWebhookDetails,
source_verified: bool,
event_type: api_models::webhooks::IncomingWebhookEvent,
event_type: webhooks::IncomingWebhookEvent,
) -> CustomResult<WebhookResponseTracker, errors::ApiErrorResponse> {
if source_verified {
let db = &*state.store;
@ -691,7 +691,7 @@ pub async fn disputes_incoming_webhook_flow(
source_verified: bool,
connector: &(dyn api::Connector + Sync),
request_details: &api::IncomingWebhookRequestDetails<'_>,
event_type: api_models::webhooks::IncomingWebhookEvent,
event_type: webhooks::IncomingWebhookEvent,
) -> CustomResult<WebhookResponseTracker, errors::ApiErrorResponse> {
metrics::INCOMING_DISPUTE_WEBHOOK_METRIC.add(&metrics::CONTEXT, 1, &[]);
if source_verified {
@ -1612,7 +1612,7 @@ pub async fn webhooks_core<W: types::OutgoingWebhookType, Ctx: PaymentMethodRetr
let is_webhook_event_supported = !matches!(
event_type,
api_models::webhooks::IncomingWebhookEvent::EventNotSupported
webhooks::IncomingWebhookEvent::EventNotSupported
);
let is_webhook_event_enabled = !utils::is_webhook_event_disabled(
&*state.clone().store,
@ -2102,7 +2102,7 @@ pub(crate) fn get_outgoing_webhook_request(
>(
outgoing_webhook, payment_response_hash_key
),
_ => get_outgoing_webhook_request_inner::<api_models::webhooks::OutgoingWebhook>(
_ => get_outgoing_webhook_request_inner::<webhooks::OutgoingWebhook>(
outgoing_webhook,
payment_response_hash_key,
),