Skip to content

Commit

Permalink
chore: run formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
hyperswitch-bot[bot] committed May 15, 2024
1 parent fb0d0bd commit df6c278
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
8 changes: 6 additions & 2 deletions crates/common_enums/src/enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2010,7 +2010,9 @@ pub enum FileUploadProvider {
Checkout,
}

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, strum::Display, strum::EnumString)]
#[derive(
Debug, Clone, PartialEq, Eq, Serialize, Deserialize, strum::Display, strum::EnumString,
)]
pub enum UsStatesAbbreviation {
AL,
AK,
Expand Down Expand Up @@ -2073,7 +2075,9 @@ pub enum UsStatesAbbreviation {
WY,
}

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, strum::Display, strum::EnumString)]
#[derive(
Debug, Clone, PartialEq, Eq, Serialize, Deserialize, strum::Display, strum::EnumString,
)]
pub enum CanadaStatesAbbreviation {
AB,
BC,
Expand Down
12 changes: 8 additions & 4 deletions crates/router/src/connector/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1796,8 +1796,10 @@ pub fn get_webhook_merchant_secret_key(connector_label: &str, merchant_id: &str)
impl ForeignTryFrom<String> for UsStatesAbbreviation {
type Error = error_stack::Report<errors::ConnectorError>;
fn foreign_try_from(value: String) -> Result<Self, Self::Error> {
let state_abbreviation_check =
StringExt::<UsStatesAbbreviation>::parse_enum(value.to_uppercase().clone(), "UsStatesAbbreviation");
let state_abbreviation_check = StringExt::<UsStatesAbbreviation>::parse_enum(
value.to_uppercase().clone(),
"UsStatesAbbreviation",
);

match state_abbreviation_check {
Ok(state_abbreviation) => Ok(state_abbreviation),
Expand Down Expand Up @@ -1877,8 +1879,10 @@ impl ForeignTryFrom<String> for UsStatesAbbreviation {
impl ForeignTryFrom<String> for CanadaStatesAbbreviation {
type Error = error_stack::Report<errors::ConnectorError>;
fn foreign_try_from(value: String) -> Result<Self, Self::Error> {
let state_abbreviation_check =
StringExt::<CanadaStatesAbbreviation>::parse_enum(value.to_uppercase().clone(), "CanadaStatesAbbreviation");
let state_abbreviation_check = StringExt::<CanadaStatesAbbreviation>::parse_enum(
value.to_uppercase().clone(),
"CanadaStatesAbbreviation",
);
match state_abbreviation_check {
Ok(state_abbreviation) => Ok(state_abbreviation),
Err(_) => {
Expand Down

0 comments on commit df6c278

Please sign in to comment.