Skip to content

Allow Result.wrap and Result.wrapAsync to take function op having as many arguments as needed - #71

Open
jamesrswift wants to merge 3 commits into
vultix:masterfrom
jamesrswift:Variadic-Params
Open

Allow Result.wrap and Result.wrapAsync to take function op having as many arguments as needed#71
jamesrswift wants to merge 3 commits into
vultix:masterfrom
jamesrswift:Variadic-Params

Conversation

@jamesrswift

Copy link
Copy Markdown

The functions Result.wrap and Result.wrapAsync have been rewritten such that argument op can be a function 0 or more arguments (previously only 0 arguments). An additional variadic argument is added to support passing arguments to op, preserving type support.

Additionally, the return type of BaseResult<T, E>.expectErr is now correctly specified as E the type of the error, rather than T (which narrows to never in ErrImpl<E>)

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.

1 participant