Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(connector): [Klarna] Expand wildcard match arms #2403

Merged

Conversation

korrat
Copy link
Contributor

@korrat korrat commented Oct 1, 2023

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

Match arms using the wildcard patten (_) can be dangereous when extending enums since developers may miss locations where new variants should be handled. This patch expands all wildcard patterns in the Klarna connector to avoid this problem.

Motivation and Context

Fixes #2273

How did you test it?

cargo check, cargo clippy, and cargo test all pass without errors in modified files.

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code
  • I added unit tests for my changes where possible
  • I added a CHANGELOG entry if applicable

Match arms using the wildcard patten (`_`) can be dangereous when
extending enums since developers may miss locations where new variants
should be handled. This patch expands all wildcard patterns in the
Klarna connector to avoid this problem.
@korrat korrat requested a review from a team as a code owner October 1, 2023 10:51
@AkshayaFoiger AkshayaFoiger added the A-connector-integration Area: Connector integration label Oct 1, 2023
@SanchithHegde SanchithHegde changed the title refactor(router): expand wildcard match arms refactor(connector): [Klarna] Expand wildcard match arms Oct 1, 2023
@ArjunKarthik ArjunKarthik added the S-waiting-on-approval Status: Review completed, awaiting for approvals from code-owners label Oct 1, 2023
Copy link
Member

@SanchithHegde SanchithHegde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, @korrat!

@SanchithHegde SanchithHegde added C-refactor Category: Refactor hacktoberfest-accepted Pull requests accepted as Hacktoberfest contributions hacktoberfest Issues that are up for grabs for Hacktoberfest participants labels Oct 1, 2023
@SanchithHegde SanchithHegde added this pull request to the merge queue Oct 1, 2023
@SanchithHegde SanchithHegde removed the S-waiting-on-approval Status: Review completed, awaiting for approvals from code-owners label Oct 1, 2023
Merged via the queue into juspay:main with commit 89cb63b Oct 1, 2023
11 checks passed
@korrat korrat deleted the klarna-remove-default-case-handling branch October 2, 2023 05:25
@VedantKhairnar
Copy link
Contributor

Hey @korrat ,
Thanks for your contribution to our product.
.
We wanted to give you a shoutout on our social media and wanted your consent for using your LinkedIn avatar for the same. If you have any other preferences, please let me know. : )

Thanks,
Vedant

@VedantKhairnar
Copy link
Contributor

Hey @korrat 👋,
Thanks a bunch for all your contributions! We've got a little something for you to show our appreciation.
Just take a moment to fill out this form, and get ready for some awesome swag coming your way.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-connector-integration Area: Connector integration C-refactor Category: Refactor hacktoberfest Issues that are up for grabs for Hacktoberfest participants hacktoberfest-accepted Pull requests accepted as Hacktoberfest contributions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[REFACTOR]: [Klarna] Remove Default Case Handling
5 participants