mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-01 19:42:27 +08:00
chore: address Rust 1.76 clippy lints (#3605)
This commit is contained in:
@ -42,7 +42,7 @@ where
|
||||
let start_instant = Instant::now();
|
||||
logger::info!(tag = ?Tag::BeginRequest, payload = ?payload);
|
||||
|
||||
let res = match metrics::request::record_request_time_metric(
|
||||
let server_wrap_util_res = metrics::request::record_request_time_metric(
|
||||
api::server_wrap_util(
|
||||
&flow,
|
||||
state.clone().into(),
|
||||
@ -58,7 +58,9 @@ where
|
||||
.map(|response| {
|
||||
logger::info!(api_response =? response);
|
||||
response
|
||||
}) {
|
||||
});
|
||||
|
||||
let res = match server_wrap_util_res {
|
||||
Ok(api::ApplicationResponse::Json(response)) => {
|
||||
let response = S::try_from(response);
|
||||
match response {
|
||||
|
||||
@ -656,7 +656,7 @@ impl AddressInterface for MockDb {
|
||||
address_update: storage_types::AddressUpdate,
|
||||
key_store: &domain::MerchantKeyStore,
|
||||
) -> CustomResult<domain::Address, errors::StorageError> {
|
||||
match self
|
||||
let updated_addr = self
|
||||
.addresses
|
||||
.lock()
|
||||
.await
|
||||
@ -667,7 +667,8 @@ impl AddressInterface for MockDb {
|
||||
AddressUpdateInternal::from(address_update).create_address(a.clone());
|
||||
*a = address_updated.clone();
|
||||
address_updated
|
||||
}) {
|
||||
});
|
||||
match updated_addr {
|
||||
Some(address_updated) => address_updated
|
||||
.convert(key_store.key.get_inner())
|
||||
.await
|
||||
@ -687,7 +688,7 @@ impl AddressInterface for MockDb {
|
||||
key_store: &domain::MerchantKeyStore,
|
||||
_storage_scheme: MerchantStorageScheme,
|
||||
) -> CustomResult<domain::Address, errors::StorageError> {
|
||||
match self
|
||||
let updated_addr = self
|
||||
.addresses
|
||||
.lock()
|
||||
.await
|
||||
@ -698,7 +699,8 @@ impl AddressInterface for MockDb {
|
||||
AddressUpdateInternal::from(address_update).create_address(a.clone());
|
||||
*a = address_updated.clone();
|
||||
address_updated
|
||||
}) {
|
||||
});
|
||||
match updated_addr {
|
||||
Some(address_updated) => address_updated
|
||||
.convert(key_store.key.get_inner())
|
||||
.await
|
||||
@ -757,7 +759,7 @@ impl AddressInterface for MockDb {
|
||||
address_update: storage_types::AddressUpdate,
|
||||
key_store: &domain::MerchantKeyStore,
|
||||
) -> CustomResult<Vec<domain::Address>, errors::StorageError> {
|
||||
match self
|
||||
let updated_addr = self
|
||||
.addresses
|
||||
.lock()
|
||||
.await
|
||||
@ -771,7 +773,8 @@ impl AddressInterface for MockDb {
|
||||
AddressUpdateInternal::from(address_update).create_address(a.clone());
|
||||
*a = address_updated.clone();
|
||||
address_updated
|
||||
}) {
|
||||
});
|
||||
match updated_addr {
|
||||
Some(address) => {
|
||||
let address: domain::Address = address
|
||||
.convert(key_store.key.get_inner())
|
||||
|
||||
@ -691,7 +691,7 @@ impl MerchantConnectorAccountInterface for MockDb {
|
||||
merchant_connector_account: storage::MerchantConnectorAccountUpdateInternal,
|
||||
key_store: &domain::MerchantKeyStore,
|
||||
) -> CustomResult<domain::MerchantConnectorAccount, errors::StorageError> {
|
||||
match self
|
||||
let mca_update_res = self
|
||||
.merchant_connector_accounts
|
||||
.lock()
|
||||
.await
|
||||
@ -709,8 +709,9 @@ impl MerchantConnectorAccountInterface for MockDb {
|
||||
.await
|
||||
.change_context(errors::StorageError::DecryptionError)
|
||||
})
|
||||
.await
|
||||
{
|
||||
.await;
|
||||
|
||||
match mca_update_res {
|
||||
Some(result) => result,
|
||||
None => {
|
||||
return Err(errors::StorageError::ValueNotFound(
|
||||
|
||||
@ -212,7 +212,7 @@ impl PaymentMethodInterface for MockDb {
|
||||
payment_method: storage::PaymentMethod,
|
||||
payment_method_update: storage::PaymentMethodUpdate,
|
||||
) -> CustomResult<storage::PaymentMethod, errors::StorageError> {
|
||||
match self
|
||||
let pm_update_res = self
|
||||
.payment_methods
|
||||
.lock()
|
||||
.await
|
||||
@ -224,7 +224,9 @@ impl PaymentMethodInterface for MockDb {
|
||||
.create_payment_method(pm.clone());
|
||||
*pm = payment_method_updated.clone();
|
||||
payment_method_updated
|
||||
}) {
|
||||
});
|
||||
|
||||
match pm_update_res {
|
||||
Some(result) => Ok(result),
|
||||
None => Err(errors::StorageError::ValueNotFound(
|
||||
"cannot find payment method to update".to_string(),
|
||||
|
||||
@ -1083,7 +1083,7 @@ where
|
||||
let start_instant = Instant::now();
|
||||
logger::info!(tag = ?Tag::BeginRequest, payload = ?payload);
|
||||
|
||||
let res = match metrics::request::record_request_time_metric(
|
||||
let server_wrap_util_res = metrics::request::record_request_time_metric(
|
||||
server_wrap_util(
|
||||
&flow,
|
||||
state.clone(),
|
||||
@ -1099,7 +1099,9 @@ where
|
||||
.map(|response| {
|
||||
logger::info!(api_response =? response);
|
||||
response
|
||||
}) {
|
||||
});
|
||||
|
||||
let res = match server_wrap_util_res {
|
||||
Ok(ApplicationResponse::Json(response)) => match serde_json::to_string(&response) {
|
||||
Ok(res) => http_response_json(res),
|
||||
Err(_) => http_response_err(
|
||||
|
||||
@ -109,7 +109,7 @@ where
|
||||
{
|
||||
Ok(x) => Ok(x),
|
||||
Err(mut err) => {
|
||||
match state
|
||||
let update_res = state
|
||||
.process_tracker_update_process_status_by_ids(
|
||||
pt_batch.trackers.iter().map(|process| process.id.clone()).collect(),
|
||||
storage::ProcessTrackerUpdate::StatusUpdate {
|
||||
@ -123,7 +123,9 @@ where
|
||||
}, |count| {
|
||||
logger::debug!("Updated status of {count} processes");
|
||||
Ok(())
|
||||
}) {
|
||||
});
|
||||
|
||||
match update_res {
|
||||
Ok(_) => (),
|
||||
Err(inner_err) => {
|
||||
err.extend_one(inner_err);
|
||||
|
||||
@ -56,7 +56,6 @@ where
|
||||
|
||||
// Open the file in write mode or create it if it doesn't exist
|
||||
let mut file = std::fs::OpenOptions::new()
|
||||
.write(true)
|
||||
.append(true)
|
||||
.create(true)
|
||||
.open(file_path)?;
|
||||
|
||||
Reference in New Issue
Block a user