chore: address Rust 1.81.0 clippy lints (#5832)

This commit is contained in:
Chethan Rao
2024-09-10 13:09:07 +05:30
committed by GitHub
parent d5fee45ead
commit 933cef425f
8 changed files with 13 additions and 16 deletions

View File

@ -1017,11 +1017,12 @@ impl api::IncomingWebhook for Globalpay {
&self,
request: &api::IncomingWebhookRequestDetails<'_>,
) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
let details = std::str::from_utf8(request.body)
.change_context(errors::ConnectorError::WebhookBodyDecodingFailed)?;
Ok(Box::new(serde_json::from_str(details).change_context(
errors::ConnectorError::WebhookResourceObjectNotFound,
)?))
Ok(Box::new(
request
.body
.parse_struct::<GlobalpayPaymentsResponse>("GlobalpayPaymentsResponse")
.change_context(errors::ConnectorError::WebhookBodyDecodingFailed)?,
))
}
}

View File

@ -52,7 +52,7 @@ impl HealthCheckInterface for app::SessionState {
logger::debug!("Redis set_key was successful");
redis_conn
.get_key("test_key")
.get_key::<()>("test_key")
.await
.change_context(errors::HealthCheckRedisError::GetFailed)?;

View File

@ -88,11 +88,10 @@ impl SurchargeSource {
)
})
.transpose()?
.map(|surcharge_details| {
.inspect(|surcharge_details| {
let (surcharge_metadata, surcharge_key) = surcharge_metadata_and_key;
surcharge_metadata
.insert_surcharge_details(surcharge_key, surcharge_details.clone());
surcharge_details
}))
}
Self::Predetermined(request_surcharge_details) => Ok(Some(

View File

@ -145,7 +145,7 @@ where
.to_validate_request()?
.validate_request(&req, &merchant_account)?;
tracing::Span::current().record("payment_id", &format!("{}", validate_result.payment_id));
tracing::Span::current().record("payment_id", format!("{}", validate_result.payment_id));
let operations::GetTrackerResponse {
operation,