From 7fd10ac51d40b2bc3471bd5f35942ac08a689c54 Mon Sep 17 00:00:00 2001 From: Calascibetta Romain Date: Tue, 15 Sep 2020 14:33:31 +0200 Subject: [PATCH] Delete impl. of Cstruct_cap.to_{bytes,string} and use default impl. provided by Cstruct module --- lib/cstruct_cap.ml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/lib/cstruct_cap.ml b/lib/cstruct_cap.ml index 555457a..21d840d 100644 --- a/lib/cstruct_cap.ml +++ b/lib/cstruct_cap.ml @@ -32,20 +32,6 @@ external wo : 'a wr t -> wo t = "%identity" let of_string = Cstruct.of_string ?allocator:None let of_bytes = Cstruct.of_bytes ?allocator:None -let to_string ?(off= 0) ?len t = - let len = match len with - | Some len -> len - | None -> Cstruct.length t - off in - Cstruct.copy t off len - -let to_bytes ?(off= 0) ?len t = - let len = match len with - | Some len -> len - | None -> Cstruct.length t - off in - (* XXX(dinosaure): this is safe when [copy] allocates itself [bytes] - and uses [Bytes.unsafe_to_string]. *) - Bytes.unsafe_of_string (Cstruct.copy t off len) - let pp ppf t = Cstruct.hexdump_pp ppf t let length = Cstruct.length