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()