diff options
Diffstat (limited to 'src/render.rs')
-rw-r--r-- | src/render.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/render.rs b/src/render.rs index d0852fa3959a..ea198c31de3a 100644 --- a/src/render.rs +++ b/src/render.rs @@ -246,7 +246,8 @@ impl Handler<EditPostPage> for Renderer { } /// Message used to render search results -#[derive(Serialize)] +#[derive(Template)] +#[template(path = "search.html")] pub struct SearchResultPage { pub query: String, pub results: Vec<SearchResult>, @@ -257,6 +258,6 @@ impl Handler<SearchResultPage> for Renderer { type Result = Result<String>; fn handle(&mut self, msg: SearchResultPage, _: &mut Self::Context) -> Self::Result { - Ok(self.tera.render("search.html", &msg)?) + msg.render().map_err(|e| e.into()) } } |