From f3d8eea54647020ec1d570cad59c7937014c90b5 Mon Sep 17 00:00:00 2001 From: rand00 Date: Sun, 26 Jun 2022 18:26:40 +0200 Subject: [PATCH] Fixed unused param + simplification --- lib/builder_web.ml | 6 ++---- lib/views.ml | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/builder_web.ml b/lib/builder_web.ml index 7754bf8..41ba400 100644 --- a/lib/builder_web.ml +++ b/lib/builder_web.ml @@ -673,13 +673,11 @@ let error_template error _debug_info suggested_response = | None -> "?" | Some req -> Dream.target req in let referer = - error.Dream.request - |> Option.map (fun req -> Dream.header req "referer") - |> Option.value ~default:None + Option.bind error.Dream.request (fun req -> Dream.header req "referer") in let html = if is_iframe_page ~req:error.Dream.request then - Views.viz_not_found ~target + Views.viz_not_found else Views.page_not_found ~target ~referer in diff --git a/lib/views.ml b/lib/views.ml index b90459a..5498b21 100644 --- a/lib/views.ml +++ b/lib/views.ml @@ -235,7 +235,7 @@ let page_not_found ~target ~referer = ) |> layout ~title:"Page not found" -let viz_not_found ~target = +let viz_not_found = let title = "Visualization not found" in let content = [