def truncate

lawful-bytes@0.1.1.0 · bytes.bend:146

import lawful-bytes@0.1.1.0/bytes.bend as Bytes
import Base
import lawful-bytes@0.1.1.0/defs.bend as D

146# Only the first n bytes kept (for n <= len).
147def truncate(b: D.Bytes, +n: U32) -> D.Bytes:
148  D.Bytes{len, buf} = b
149  D.Bytes{n, buf}

Uses (2)

Used by (9)