From b22e50d439e2158a56e060a33c039282089fd43e Mon Sep 17 00:00:00 2001 From: Elara Musayelyan Date: Wed, 4 Oct 2023 20:47:30 -0700 Subject: [PATCH] Remove MustValue from optional type --- optional.go | 8 -------- 1 file changed, 8 deletions(-) diff --git a/optional.go b/optional.go index ee1ac02..e7d905a 100644 --- a/optional.go +++ b/optional.go @@ -39,14 +39,6 @@ func (o Optional[T]) IsValid() bool { return o.value != nil } -// MustValue returns the value in the optional. It panics if the value is nil. -func (o Optional[T]) MustValue() T { - if o.value == nil { - panic("optional value is nil") - } - return *o.value -} - // Value returns the value in the optional. func (o Optional[T]) Value() (T, bool) { if o.value != nil {