Skip to content

Conversation

miquelbeltran
Copy link
Member

As discussed in the PR for the Result pattern implementation (flutter/website#11444) @parlough recommended that asError and asOk should be not be used, and instead we should use proper exhaustiveness checking.

This PR removes the two "convenience" methods and refactors code.

In some cases, it was enough with writing a proper if clause, while in others it was necessary to use a switch.

Still, they are present in the testing folder, as they can be useful for testing purposes.

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-devrel channel on Discord.

Copy link
Collaborator

@ericwindmill ericwindmill left a comment

Choose a reason for hiding this comment

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

Yes, this was a very good idea! Thank you @miquelbeltran and @parlough

@ericwindmill ericwindmill merged commit 57ecb5f into main Dec 5, 2024
13 checks passed
@ericwindmill ericwindmill deleted the mb-refactor-result branch December 5, 2024 18:16
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.

2 participants