mirror of
https://github.com/ocaml-tracing/ocaml-opentelemetry.git
synced 2026-03-07 18:37:56 -05:00
fix: no List.find_map in ocaml 4.08
This commit is contained in:
parent
1cd536cb8e
commit
efbb3469c6
1 changed files with 6 additions and 6 deletions
|
|
@ -228,12 +228,12 @@ module Globals = struct
|
|||
with _ -> []
|
||||
|
||||
let get_global_attr_ key =
|
||||
global_attributes
|
||||
|> List.find_map (fun kv ->
|
||||
if kv.key = key then
|
||||
match kv.value with Some (String_value v) -> Some v | _ -> None
|
||||
else None)
|
||||
|
||||
let attr =
|
||||
global_attributes |> List.find_opt (fun kv -> kv.key = key)
|
||||
in
|
||||
match attr with
|
||||
| Some kv -> (match kv.value with Some (String_value v) -> Some v | _ -> None)
|
||||
| _ -> None
|
||||
|
||||
(** Main service name metadata *)
|
||||
let service_name =
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue