Skip to content

0.2.3

Pre-release
Pre-release

Choose a tag to compare

@kennethnym kennethnym released this 02 May 21:59
· 2 commits to main since this release

This release updates unwrap/unwrapErr/expect/expectErr messages to match Rust's implementation:

  • unwrap on Err now throws an error with the error message being the containing error value
    • e.g. err("emergency").unwrap() throws an Error with emergency as the message
  • unwrapErr on Ok now throws an error with the error message being the containing value
    • e.g. ok(123).unwrapErr() throws an Error with 123 as the message
  • expect on Err now throws an error with the provided message and the containing error value as the message
    • e.g. err("failed").expect("should not fail") throws an Error with should not failed: failed as the message
  • expectErr on Ok now throws an error with the provided message and the containing value as the message
    • e.g. ok("hello").expectErr("should fail") throws an Error with should fail: hello as the message