From 1439e529ad428450be05f3f319a4ca92e9f5a188 Mon Sep 17 00:00:00 2001 From: Hannes Mehnert Date: Mon, 11 Dec 2023 14:37:03 +0100 Subject: [PATCH] use Option in printing of Gc keys --- lib/mirage/mirage.ml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/mirage/mirage.ml b/lib/mirage/mirage.ml index c5d209989..6f0c83c63 100644 --- a/lib/mirage/mirage.ml +++ b/lib/mirage/mirage.ml @@ -439,11 +439,10 @@ let gc_control = Fmt.( any name ++ any " = " - ++ any "(match " - ++ Mirage_impl_misc.pp_key - ++ any " with None -> ctrl." + ++ any "Option.value ~default:ctrl." ++ any name - ++ any " | Some x -> x)") + ++ any " " + ++ Mirage_impl_misc.pp_key) in let keys = Key. @@ -462,8 +461,8 @@ let gc_control = in let connect _ _ _ = Fmt.str - "return (@.@[let open Gc in@ let ctrl = get () in@ set ({ ctrl with \ - %a;@ %a;@ %a;@ %a;@ %a;@ %a;@ %a;@ %a;@ %a;@ %a })@]@.)" + "return (@.@[let open Gc in@ let ctrl = get () in@ set { ctrl with \ + %a;@ %a;@ %a;@ %a;@ %a;@ %a;@ %a;@ %a;@ %a;@ %a }@]@.)" (pp_pol ~name:"allocation_policy") Key.allocation_policy (pp_k ~name:"minor_heap_size")