Port bytes::cut / bytes::rcut from ref/hare/bytes/tokenize.ha:392,413. Both return borrowed (before, after) views split on the first / last delimiter instance; void-case yields (whole input, empty). Needle order is ww's (u8 | []u8), matching index/rindex (bytes.ww:57/91) rather than Hare's ([]u8 | u8). Unblocked by #10 (wide tuple-return / sret): ([]u8, []u8) is 48B, over-cap, returned via sret and received by the call-site destructure the tests exercise. combined.ww amalgamations regenerated (bytes is compiler-imported via strings).
30 KiB
30 KiB