From 3441a0f2fbb19461039ce16a0387c8d02da08bf0 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Fri, 17 Apr 2026 17:41:46 +0000 Subject: refactor: Tighten dead branches and fail fast on missing index.html --- src/mayu.gleam | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/mayu.gleam') diff --git a/src/mayu.gleam b/src/mayu.gleam index 441887d..bb05b77 100644 --- a/src/mayu.gleam +++ b/src/mayu.gleam @@ -18,14 +18,9 @@ pub fn main() { Ok(version) -> "(v" <> version <> ")" Error(_) -> "" } - let index_html = case simplifile.read("index.html") { - Ok(content) -> string.replace(content, "{{ MAYU_VERSION }}", version_tag) - Error(_) -> { - wisp.log_error("Failed to read index.html") - - "" - } - } + let assert Ok(index_html_source) = simplifile.read("index.html") + let index_html = + string.replace(index_html_source, "{{ MAYU_VERSION }}", version_tag) use connection <- sqlight.with_connection("./data/count.db") -- cgit v1.2.3