From adbec47638563f4f2b8e0d802485c8c2da784be0 Mon Sep 17 00:00:00 2001 From: Samuel Jones Date: Sat, 13 Jun 2026 16:02:33 +0100 Subject: [PATCH] Preparation of template complete for learning API calls. --- src/main.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main.rs b/src/main.rs index 88343e0..3de4beb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,9 +12,12 @@ async fn main() { } async fn app_content() -> Html { - Html( - fs::read_to_string("./media/template.html") - .unwrap_or_default() - .to_string(), - ) + let template = fs::read_to_string("./media/template.html") + .unwrap_or_default() + .to_string(); + let mut split = template.splitn(2, ""); + let mut result = split.next().unwrap().to_string(); + result.push_str("Table Here!
(This is the position in the template the Rust code identified for the API result.)"); + result.push_str(split.next().unwrap()); + Html(result) }