From 7137d2790ffa9d61ce27d3fd329c5236eb78ce93 Mon Sep 17 00:00:00 2001 From: Swrup Date: Mon, 21 Feb 2022 11:33:03 +0100 Subject: [PATCH] fix unwrap_list --- src/babillard.ml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/babillard.ml b/src/babillard.ml index 9be66af..4a7efd0 100644 --- a/src/babillard.ml +++ b/src/babillard.ml @@ -26,9 +26,10 @@ type t = let unwrap_list f ids = let l = List.map f ids in let res = List.find_opt Result.is_error l in - if Option.is_some res then - Error (Result.fold ~ok:(assert false) ~error:Fun.id (Option.get res)) - else Ok (List.map Result.get_ok l) + match res with + | None -> Ok (List.map Result.get_ok l) + | Some (Ok _) -> assert false + | Some (Error e) -> Error e module Q = struct let create_post_user_table =