fix: no List.find_map in ocaml 4.08

This commit is contained in:
Matt Bray 2022-03-28 15:06:32 +01:00
parent 1cd536cb8e
commit efbb3469c6

View file

@ -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 =