aboutsummaryrefslogtreecommitdiff
path: root/src/controller/error.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/controller/error.rs')
-rw-r--r--src/controller/error.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/controller/error.rs b/src/controller/error.rs
index 0f6dcc1..fb1375c 100644
--- a/src/controller/error.rs
+++ b/src/controller/error.rs
@@ -3,7 +3,6 @@ use hyper::body::Bytes;
use hyper::header::CACHE_CONTROL;
use hyper::Response;
use std::collections::HashMap;
-use tera::{Context, Tera};
use crate::controller::utils;
use crate::controller::wallet::Wallet;
@@ -24,14 +23,15 @@ pub fn error(
pub fn template(
assets: &HashMap<String, String>,
- templates: &Tera,
+ templates: &minijinja::Environment<'_>,
title: &str,
message: &str,
) -> String {
- let mut context = Context::new();
- context.insert("title", title);
- context.insert("message", message);
- context.insert("assets", assets);
+ let context = minijinja::context!(
+ title => title,
+ message => message,
+ assets => assets
+ );
- templates.render("error.html", &context).unwrap()
+ templates.render_str("error.html", &context).unwrap()
}