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

Add pattern matching support for Result #134

Merged
merged 1 commit into from
Mar 11, 2024

Conversation

stephannv
Copy link
Contributor

@stephannv stephannv commented Feb 29, 2024

Fixes: #133

I'm not sure if we should use success?: true, failure?: false or success: true, failure: false. Since we are handling hashes, I don't like the ? on keys.

ps. There is error on linter because it is using Ruby 2.4 parser and pattern matching is supported on >= 2.7. It can be fixed with:

# .rubocop.yml
AllCops:
  TargetRubyVersion: 3.0 # or 2.7

But it will recommend another improvements on other files.

@stephannv stephannv force-pushed the feat/deconstruct_keys branch 2 times, most recently from 0ac6c90 to d6200a1 Compare February 29, 2024 20:23
Copy link
Owner

@sunny sunny left a comment

Choose a reason for hiding this comment

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

Awesome! Thank you \o/ 🤩

I agree that success: and failure: look a bit better than when using the success?: and failure?:.

As for Ruby 2.4 we should probably wait for #126 to be merged first for the specs to run fine here 🙏🏻

@sunny
Copy link
Owner

sunny commented Mar 11, 2024

Ruby 2.4 support has been dropped, can you merge the latest changes from main? 🙏🏻

@stephannv stephannv force-pushed the feat/deconstruct_keys branch from d6200a1 to fd846b9 Compare March 11, 2024 15:05
@stephannv stephannv requested a review from sunny March 11, 2024 15:06
Copy link
Owner

@sunny sunny left a comment

Choose a reason for hiding this comment

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

👏🏻 👏🏻

@sunny sunny merged commit b42ab64 into sunny:main Mar 11, 2024
7 checks passed
@sunny
Copy link
Owner

sunny commented Mar 11, 2024

Thank you for this contribution 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make Actor result + pattern matching more pleasant
2 participants