use Bytes.unsafe_to_string

This commit is contained in:
Matt Bray 2022-03-24 17:36:45 +00:00
parent 1e96404502
commit 0cd75d5a6d

View file

@ -612,7 +612,7 @@ module Trace_context = struct
let buf = Bytes.create len in
let* str =
match Bytes.blit_string str offset buf 0 len with
| () -> Ok (Bytes.to_string buf)
| () -> Ok (Bytes.unsafe_to_string buf)
| exception Invalid_argument _ -> Error or_
in
Ok (str, offset + len)