Skip to content

Introducing "unwrapOr" method

Choose a tag to compare

@supermacro supermacro released this 01 Jul 13:09
· 655 commits to master since this release

This PR introduces a new method for synchronous Results:

✨ ✨ unwrapOr ✨ ✨

Type signature:

Result<T, E>.unwrapOr(default: T) => T

The method takes a Result and returns the inner T when you have an Ok, or it returns the default value when you have an Err.

Thanks to @pawndev for the contribution! 🚀