Takes the error value as an optional if the result is an Err, otherwise returns None.
Err
None
The source result.
The error value if exists.
expect(optionErr(ok(2))).toStrictEqual(none());expect(optionErr(err("nothing left"))).toStrictEqual(some("nothing left")); Copy
expect(optionErr(ok(2))).toStrictEqual(none());expect(optionErr(err("nothing left"))).toStrictEqual(some("nothing left"));
Takes the error value as an optional if the result is an
Err, otherwise returnsNone.