From 4843be7dc2f496501c44ab7eb3eb153a7da9528b Mon Sep 17 00:00:00 2001 From: Sijmen Date: Thu, 27 Apr 2023 14:07:53 +0200 Subject: [PATCH] Remove unused template parameters in get_index --- src/main.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/main.rs b/src/main.rs index 55ea9d7..e0a03e5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -13,9 +13,7 @@ mod mpd; #[derive(Template)] #[template(path = "index.html")] -struct IndexTemplate { - path: String, -} +struct IndexTemplate; #[derive(Deserialize, Default)] #[serde(default)] @@ -23,10 +21,8 @@ struct IndexQuery { path: String, } -async fn get_index(req: tide::Request<()>) -> tide::Result { - let query: IndexQuery = req.query()?; - let template = IndexTemplate { path: query.path }; - Ok(askama_tide::into_response(&template)) +async fn get_index(_req: tide::Request<()>) -> tide::Result { + Ok(askama_tide::into_response(&IndexTemplate)) } #[derive(Template)]