diff --git a/src/Result.class.ts b/src/Result.class.ts index 6e61919..08083ef 100644 --- a/src/Result.class.ts +++ b/src/Result.class.ts @@ -100,28 +100,28 @@ export class RustlikeResult implements Result { inspect(fn: (value: T) => void): this { if (this.isOk()) { - fn(this.unwrapUnchecked()); + fn(this._value!); } return this; } async inspectAsync(fn: (value: T) => void | Promise): Promise { if (this.isOk()) { - await fn(this.unwrapUnchecked()); + await fn(this._value!); } return this; } inspectErr(fn: (err: E) => void): this { if (this.isErr()) { - fn(this.unwrapErrUnchecked()); + fn(this._error!); } return this; } async inspectErrAsync(fn: (err: E) => void | Promise): Promise { if (this.isErr()) { - await fn(this.unwrapErrUnchecked()); + await fn(this._error!); } return this; }