Renamed Result.Succeeded to Status and removed Failed
This commit is contained in:
@ -19,10 +19,10 @@ func Bind{{.}}[In, Out{{range .Count}}, T{{.}}{{end}} any](
|
||||
return Result[In, Out]{}, err
|
||||
}
|
||||
anyConsumed = anyConsumed || r{{.}}.Consumed()
|
||||
if r{{.}}.Failed() {
|
||||
success, val{{.}}, next := r{{.}}.Status()
|
||||
if !success {
|
||||
return Fail[In, Out](anyConsumed, r{{.}}.Message()), nil
|
||||
}
|
||||
_, val{{.}}, next := r{{.}}.Succeeded()
|
||||
{{end}}
|
||||
return Succeed(anyConsumed, val{{.Next}}, next, MessageOK(s.Pos())), nil
|
||||
}
|
||||
|
@ -15,10 +15,10 @@ func Seq{{.}}[In, Out{{range .Count}}, T{{.}}{{end}} any](
|
||||
return Result[In, Out]{}, err
|
||||
}
|
||||
anyConsumed = anyConsumed || r{{.}}.Consumed()
|
||||
if r{{.}}.Failed() {
|
||||
success, val{{.}}, next := r{{.}}.Status()
|
||||
if !success {
|
||||
return Fail[In, Out](anyConsumed, r{{.}}.Message()), nil
|
||||
}
|
||||
_, val{{.}}, next := r{{.}}.Succeeded()
|
||||
{{end}}
|
||||
final := f({{range .Count}}{{if ne . 1}}, {{end}}val{{.}}{{end}})
|
||||
return Succeed(anyConsumed, final, next, MessageOK(s.Pos())), nil
|
||||
|
Reference in New Issue
Block a user