mirror of
https://github.com/ocaml-tracing/ocaml-opentelemetry.git
synced 2026-03-09 04:17:56 -04:00
compat for Result
This commit is contained in:
parent
5d3fa1c8eb
commit
7fd56bb5c3
1 changed files with 7 additions and 1 deletions
|
|
@ -6,6 +6,12 @@ module Lock = Lock
|
||||||
module Rand_bytes = Rand_bytes
|
module Rand_bytes = Rand_bytes
|
||||||
(** Generation of random identifiers *)
|
(** 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} *)
|
(** {2 Wire format} *)
|
||||||
|
|
||||||
(** Protobuf types *)
|
(** Protobuf types *)
|
||||||
|
|
@ -913,7 +919,7 @@ module Trace_context = struct
|
||||||
[{flags}] are currently ignored.
|
[{flags}] are currently ignored.
|
||||||
*)
|
*)
|
||||||
let of_value str : (Trace_id.t * Span_id.t, string) result =
|
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 blit ~offset ~len ~or_ =
|
||||||
let buf = Bytes.create len in
|
let buf = Bytes.create len in
|
||||||
let* str =
|
let* str =
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue