fn: breaking - polish Either API

This commit is contained in:
Keagan McClelland committed 2024-11-06 17:32:58 -07:00
1 parent c6734ea013
commit 1805fd6f19
3 files changed
+13 -13

No files matched your search

+2 -2
View File
@@ -99,12 +99,12 @@ func MapOk[A, B any](f func(A) B) func(Result[A]) Result[B] {
//
// Deprecated: Use OkToSome instead.
func (r Result[T]) Option() Option[T] {
return r.Either.LeftToOption()
return r.Either.LeftToSome()
}
// OkToSome mutes the error value of the result.
func (r Result[T]) OkToSome() Option[T] {
return r.Either.LeftToOption()
return r.Either.LeftToSome()
}
// WhenResult executes the given function if the Result is a success.