Skip to content

Commit

Permalink
compat for Result
Browse files Browse the repository at this point in the history
  • Loading branch information
c-cube committed Jun 9, 2022
1 parent 5d3fa1c commit 7fd56bb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/opentelemetry.ml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ module Lock = Lock
module Rand_bytes = Rand_bytes
(** Generation of random identifiers *)

open struct
let result_bind x f = match x with
| Error e -> Error e
| Ok x -> f x
end

(** {2 Wire format} *)

(** Protobuf types *)
Expand Down Expand Up @@ -913,7 +919,7 @@ module Trace_context = struct
[{flags}] are currently ignored.
*)
let of_value str : (Trace_id.t * Span_id.t, string) result =
let ( let* ) = Result.bind in
let ( let* ) = result_bind in
let blit ~offset ~len ~or_ =
let buf = Bytes.create len in
let* str =
Expand Down

0 comments on commit 7fd56bb

Please sign in to comment.