From 4612cb74b2557d39d8042f4cd3f2dec3ffb507c9 Mon Sep 17 00:00:00 2001 From: milarin Date: Thu, 4 Apr 2024 19:13:43 +0200 Subject: [PATCH] refactored result wrapper func names --- result.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/result.go b/result.go index 2eb2fed..c5ab05d 100644 --- a/result.go +++ b/result.go @@ -13,12 +13,12 @@ func ResultOf[T any](value T, err error) Result[T] { return Result[T]{value: &value, err: nil} } -func WrapMapFunc[I, O any](f func(I) (O, error)) func(I) Result[O] { +func WrapResultOutputFunc[I, O any](f func(I) (O, error)) func(I) Result[O] { return func(i I) Result[O] { return ResultOf(f(i)) } } -func ResultFunc[I, O any](f func(I) (O, error)) func(Result[I]) Result[O] { - resFunc := WrapMapFunc(f) +func WrapResultFunc[I, O any](f func(I) (O, error)) func(Result[I]) Result[O] { + resFunc := WrapResultOutputFunc(f) nilValue := *new(O) return func(r Result[I]) Result[O] { v, err := r.Get()