def trim
import bend-kit-llm@0.13.0.1/sse.bend as Sseimport Base
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes
164# Drops the last LF. Bytes past len stay 0.
165def trim(b: Bytes.Bytes) -> Bytes.Bytes:
166 Bytes.Bytes{+n, buf} = b
167 Bytes.Bytes{(n - 1 : U32), Bytes.poke(buf, (n - 1 : U32), 0)}