From 7fd56bb5c3d7c0f51b7561a8dd4991309e615cc2 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Thu, 9 Jun 2022 11:28:26 -0400 Subject: [PATCH] compat for Result --- src/opentelemetry.ml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/opentelemetry.ml b/src/opentelemetry.ml index a74454d9..24180c2c 100644 --- a/src/opentelemetry.ml +++ b/src/opentelemetry.ml @@ -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 *) @@ -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 =