mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-27 19:46:48 +08:00
chore: enable clippy::trivially_copy_pass_by_ref lint and address it (#6724)
This commit is contained in:
@ -139,7 +139,7 @@ pub enum Connector {
|
||||
|
||||
impl Connector {
|
||||
#[cfg(feature = "payouts")]
|
||||
pub fn supports_instant_payout(&self, payout_method: Option<PayoutType>) -> bool {
|
||||
pub fn supports_instant_payout(self, payout_method: Option<PayoutType>) -> bool {
|
||||
matches!(
|
||||
(self, payout_method),
|
||||
(Self::Paypal, Some(PayoutType::Wallet))
|
||||
@ -148,26 +148,26 @@ impl Connector {
|
||||
)
|
||||
}
|
||||
#[cfg(feature = "payouts")]
|
||||
pub fn supports_create_recipient(&self, payout_method: Option<PayoutType>) -> bool {
|
||||
pub fn supports_create_recipient(self, payout_method: Option<PayoutType>) -> bool {
|
||||
matches!((self, payout_method), (_, Some(PayoutType::Bank)))
|
||||
}
|
||||
#[cfg(feature = "payouts")]
|
||||
pub fn supports_payout_eligibility(&self, payout_method: Option<PayoutType>) -> bool {
|
||||
pub fn supports_payout_eligibility(self, payout_method: Option<PayoutType>) -> bool {
|
||||
matches!((self, payout_method), (_, Some(PayoutType::Card)))
|
||||
}
|
||||
#[cfg(feature = "payouts")]
|
||||
pub fn is_payout_quote_call_required(&self) -> bool {
|
||||
pub fn is_payout_quote_call_required(self) -> bool {
|
||||
matches!(self, Self::Wise)
|
||||
}
|
||||
#[cfg(feature = "payouts")]
|
||||
pub fn supports_access_token_for_payout(&self, payout_method: Option<PayoutType>) -> bool {
|
||||
pub fn supports_access_token_for_payout(self, payout_method: Option<PayoutType>) -> bool {
|
||||
matches!((self, payout_method), (Self::Paypal, _))
|
||||
}
|
||||
#[cfg(feature = "payouts")]
|
||||
pub fn supports_vendor_disburse_account_create_for_payout(&self) -> bool {
|
||||
pub fn supports_vendor_disburse_account_create_for_payout(self) -> bool {
|
||||
matches!(self, Self::Stripe)
|
||||
}
|
||||
pub fn supports_access_token(&self, payment_method: PaymentMethod) -> bool {
|
||||
pub fn supports_access_token(self, payment_method: PaymentMethod) -> bool {
|
||||
matches!(
|
||||
(self, payment_method),
|
||||
(Self::Airwallex, _)
|
||||
@ -181,13 +181,13 @@ impl Connector {
|
||||
| (Self::Itaubank, _)
|
||||
)
|
||||
}
|
||||
pub fn supports_file_storage_module(&self) -> bool {
|
||||
pub fn supports_file_storage_module(self) -> bool {
|
||||
matches!(self, Self::Stripe | Self::Checkout)
|
||||
}
|
||||
pub fn requires_defend_dispute(&self) -> bool {
|
||||
pub fn requires_defend_dispute(self) -> bool {
|
||||
matches!(self, Self::Checkout)
|
||||
}
|
||||
pub fn is_separate_authentication_supported(&self) -> bool {
|
||||
pub fn is_separate_authentication_supported(self) -> bool {
|
||||
match self {
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
Self::DummyConnector1
|
||||
@ -281,15 +281,15 @@ impl Connector {
|
||||
Self::Checkout | Self::Nmi | Self::Cybersource => true,
|
||||
}
|
||||
}
|
||||
pub fn is_pre_processing_required_before_authorize(&self) -> bool {
|
||||
pub fn is_pre_processing_required_before_authorize(self) -> bool {
|
||||
matches!(self, Self::Airwallex)
|
||||
}
|
||||
pub fn should_acknowledge_webhook_for_resource_not_found_errors(&self) -> bool {
|
||||
pub fn should_acknowledge_webhook_for_resource_not_found_errors(self) -> bool {
|
||||
matches!(self, Self::Adyenplatform)
|
||||
}
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
pub fn validate_dummy_connector_enabled(
|
||||
&self,
|
||||
self,
|
||||
is_dummy_connector_enabled: bool,
|
||||
) -> errors::CustomResult<(), errors::ValidationError> {
|
||||
if !is_dummy_connector_enabled
|
||||
|
||||
Reference in New Issue
Block a user