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