def cut.next

lawful-fields@0.1.1.0 · fields.bend:13

import lawful-fields@0.1.1.0/fields.bend as Fields
import Base
import lawful-bytes@0.1.1.0/defs.bend as D
import lawful-bytes@0.1.1.0/bytes.bend as B

13# The end of the piece starting at from, searched only when want is set (no
14# scan past the last field asked for; the answer is then unused).
15def cut.next(want: Bool, b: D.Bytes, +from: U32, +to: U32, +sep: U32) -> D.Bytes & U32:
16  match want:
17    case True{}:
18      B.find(b, from, to, sep)
19    case False{}:
20      (b, to)

Uses (6)

Used by (5)