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

Empty return statement for Success? #8

Open
EricPHassey opened this issue Feb 23, 2022 · 1 comment
Open

Empty return statement for Success? #8

EricPHassey opened this issue Feb 23, 2022 · 1 comment

Comments

@EricPHassey
Copy link

Maybe there's an easy way to do this, but with this amazing package, I no longer need to return a bool internal to the class of whether it was a success or not. Is there any way to return Result<_, int> something like that. I don't need to return anything if Success. I suppose it doesn't hurt or do anything to just return Result<bool, int> and just return true, but was hoping to just clean up the code a bit for readability.

@andrewkolos
Copy link

I'm still new to Dart, but I think you can use Result<void, int> as your type and then use Success(null) to make your success object.

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

No branches or pull requests

2 participants