From 7f306e350450469ce735383727900c0e3881f7a7 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Mon, 3 Sep 2018 16:21:49 +0400 Subject: [PATCH] Simplify a pattern match with Result.is_ok? Signed-off-by: Rudi Grinberg --- src/lib.ml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/lib.ml b/src/lib.ml index cc549d39..c475fab8 100644 --- a/src/lib.ml +++ b/src/lib.ml @@ -598,9 +598,8 @@ and resolve_name db name ~stack = instantiate db name info ~stack ~hidden:(Some hidden) and available_internal db (name : Lib_name.t) ~stack = - match resolve_dep db name ~allow_private_deps:true ~loc:Loc.none ~stack with - | Ok _ -> true - | Error _ -> false + resolve_dep db name ~allow_private_deps:true ~loc:Loc.none ~stack + |> Result.is_ok and resolve_simple_deps db (names : ((Loc.t * Lib_name.t) list)) ~allow_private_deps ~stack = Result.List.map names ~f:(fun (loc, name) ->