From be6d3c4c365e15a8affd29229d13b81c8879c095 Mon Sep 17 00:00:00 2001 From: Marius Peter Date: Sat, 10 May 2025 19:22:14 +0200 Subject: Use Lwt.Syntax. --- lib/handlers.ml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib/handlers.ml') diff --git a/lib/handlers.ml b/lib/handlers.ml index 27ca0b6..f4a7d7b 100644 --- a/lib/handlers.ml +++ b/lib/handlers.ml @@ -1,10 +1,12 @@ +open Lwt.Syntax + let ogit_root _req = Views.ogit_root () |> Dream_html.respond let repo_summary req = let repo_path = Dream.param req "repo_name" in - let%lwt branches_result = Git_helpers.all_branches repo_path in - let%lwt commits_result = Git_helpers.latest_commits repo_path 10 in - match (branches_result, commits_result) with + let* branches = Git_helpers.all_branches repo_path + and* commits = Git_helpers.latest_commits repo_path 10 in + match (branches, commits) with | Ok branches, Ok commits -> Views.repo_summary repo_path ~branches ~commits |> Dream_html.respond | Error msg, _ | _, Error msg -> Views.error_page msg |> Dream_html.respond -- cgit v1.2.3