mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-27 22:21:18 +02:00
fn: breaking - polish Either API
This commit is contained in:
@@ -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.
|
||||
|
Reference in New Issue
Block a user