diff --git a/result.go b/result.go index cb1fa71..2eb2fed 100644 --- a/result.go +++ b/result.go @@ -64,7 +64,7 @@ func (r Result[T]) Err() error { } func FilterSuccess[T any](source <-chan Result[T]) <-chan T { - succeeded := Filter(source, func(r Result[T]) bool { return r.Success() }) + succeeded := Filter(source, Result[T].Success) return MapSuccessive(succeeded, func(r Result[T]) T { v, _ := r.Get() @@ -73,7 +73,7 @@ func FilterSuccess[T any](source <-chan Result[T]) <-chan T { } func FilterFail[T any](source <-chan Result[T]) <-chan T { - failed := Filter(source, func(r Result[T]) bool { return r.Fail() }) + failed := Filter(source, Result[T].Fail) return MapSuccessive(failed, func(r Result[T]) T { v, _ := r.Get() @@ -94,7 +94,7 @@ func FilterResults[T any](source <-chan Result[T]) (succeeded <-chan T, failed < fail <- r.Err() continue } - succ <- r.GetSafe() + succ <- r.GetUnsafe() } }()