refactor(ext_traits): simplify the signatures of some methods in Encode extension trait (#3687)

This commit is contained in:
Sanchith Hegde
2024-02-19 15:24:09 +05:30
committed by GitHub
parent 8038b48a54
commit 11fc9b3986
44 changed files with 392 additions and 416 deletions

View File

@ -162,10 +162,10 @@ pub async fn create_routing_config(
#[cfg(not(feature = "business_profile_routing"))]
{
let algorithm_str =
utils::Encode::<routing_types::RoutingAlgorithm>::encode_to_string_of_json(&algorithm)
.change_context(errors::ApiErrorResponse::InternalServerError)
.attach_printable("Unable to serialize routing algorithm to string")?;
let algorithm_str = algorithm
.encode_to_string_of_json()
.change_context(errors::ApiErrorResponse::InternalServerError)
.attach_printable("Unable to serialize routing algorithm to string")?;
let mut algorithm_ref: routing_types::RoutingAlgorithmRef = merchant_account
.routing_algorithm
@ -548,10 +548,10 @@ pub async fn unlink_routing_config(
)
.await?;
let ref_value =
Encode::<routing_types::RoutingAlgorithmRef>::encode_to_value(&routing_algorithm)
.change_context(errors::ApiErrorResponse::InternalServerError)
.attach_printable("Failed converting routing algorithm ref to json value")?;
let ref_value = routing_algorithm
.encode_to_value()
.change_context(errors::ApiErrorResponse::InternalServerError)
.attach_printable("Failed converting routing algorithm ref to json value")?;
let merchant_account_update = storage::MerchantAccountUpdate::Update {
merchant_name: None,