diff options
author | Marius Peter <marius.peter@tutanota.com> | 2025-05-10 19:22:14 +0200 |
---|---|---|
committer | Marius Peter <marius.peter@tutanota.com> | 2025-05-10 19:22:14 +0200 |
commit | be6d3c4c365e15a8affd29229d13b81c8879c095 (patch) | |
tree | 9dc23427363888b94ba9b3495c17805cc15aafdc | |
parent | ed813bd6035476a955dc8f1711889e7a4e62ed0d (diff) |
Use Lwt.Syntax.
-rw-r--r-- | lib/handlers.ml | 8 |
1 files changed, 5 insertions, 3 deletions
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 |