diff --git a/type/optional.go b/type/optional.go index 19e17b4..b801739 100644 --- a/type/optional.go +++ b/type/optional.go @@ -50,16 +50,14 @@ func (opt *Optional[T]) HasValue() bool { } // UNWRAPPABLE INTERFACE BEGIN -func (opt *Optional[T]) Expect(msg string) T { - Assert.NotNil(opt) +func (opt Optional[T]) Expect(msg string) T { if opt.present { return opt.value } panic(msg) } -func (opt *Optional[T]) Unwrap() T { - Assert.NotNil(opt) +func (opt Optional[T]) Unwrap() T { if opt.present { return opt.value } diff --git a/type/result.go b/type/result.go index 9402769..edd8227 100644 --- a/type/result.go +++ b/type/result.go @@ -49,16 +49,14 @@ func (res *Result[T]) HasValue() bool { } // UNWRAPPABLE INTERFACE -func (res *Result[T]) Expect(msg string) T { - Assert.NotNil(res) +func (res Result[T]) Expect(msg string) T { if res.err == nil { return res.value } panic(msg) } -func (res *Result[T]) Unwrap() T { - Assert.NotNil(res) +func (res Result[T]) Unwrap() T { if res.err == nil { return res.value }