-
Notifications
You must be signed in to change notification settings - Fork 10
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
How to create Result<void, Failure>? #10
Comments
From what I can tell, Dart does not have a "unit" type like Rust, and void func() {
return;
}
var result = Result.of(() => func()); The type of |
Couldn't you create Result.okVoid, which doesn't return anything? |
I tried a few things and nothing would pass the compiler, it insists that the value must be of type |
For that issue, |
Let me know if commit a692c01 is what you're looking for. |
Couldn't you do this by removing the Removing them shouldn't break existing code (as loosening bounds shouldn't do that), and would permit |
@Stumblinbear Your contributions would be welcome, please feel free to submit a PR. |
It's not allowed to leave Result.ok empty. How to achieve void behaviour? Null is pretty awful workaround.
The text was updated successfully, but these errors were encountered: