mirror of https://github.com/rwf2/Rocket.git
shorter, fits 85 cols
This commit is contained in:
parent
5b1186a530
commit
eae22e8dea
|
@ -8,11 +8,10 @@ use super::{TemplateInfo, TEMPLATE_DIR};
|
||||||
lazy_static! {
|
lazy_static! {
|
||||||
static ref TERA: Result<tera::Tera, String> = {
|
static ref TERA: Result<tera::Tera, String> = {
|
||||||
let path: PathBuf = [&*TEMPLATE_DIR, "**", "*.tera"].iter().collect();
|
let path: PathBuf = [&*TEMPLATE_DIR, "**", "*.tera"].iter().collect();
|
||||||
let escape_ext = [".html.tera", ".htm.tera", ".xml.tera",
|
let ext = [".html.tera", ".htm.tera", ".xml.tera", ".html", ".htm", ".xml"];
|
||||||
".html", ".htm", ".xml"];
|
|
||||||
tera::Tera::new(path.to_str().unwrap())
|
tera::Tera::new(path.to_str().unwrap())
|
||||||
.map(|mut tera| {
|
.map(|mut tera| {
|
||||||
tera.autoescape_on(escape_ext.to_vec());
|
tera.autoescape_on(ext.to_vec());
|
||||||
tera
|
tera
|
||||||
})
|
})
|
||||||
.map_err(|e| format!("{:?}", e))
|
.map_err(|e| format!("{:?}", e))
|
||||||
|
|
Loading…
Reference in New Issue