diff options
author | Lars Wirzenius <liw@liw.fi> | 2023-04-01 17:26:03 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2023-04-01 17:30:59 +0300 |
commit | 6a10fe52584fe5eb323a41d51e45f788b9f96f4c (patch) | |
tree | 47e079704431dd1231da7bb056e119da28ff7e5f /src/codegen.rs | |
parent | ac045b32017cf4bb2cd25c2c711e68b2e2d74261 (diff) | |
download | subplot-6a10fe52584fe5eb323a41d51e45f788b9f96f4c.tar.gz |
fix: create Tera using ::default, instead of ::new
Tera now returns an error if Tera::new is given a glob that references
a directory that doesn't exist. We don't want to use the glob at all,
so Tera::default is a better way to create a Tera.
Sponsored-by: author
Diffstat (limited to 'src/codegen.rs')
-rw-r--r-- | src/codegen.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/codegen.rs b/src/codegen.rs index 5c4255f..8c69ed3 100644 --- a/src/codegen.rs +++ b/src/codegen.rs @@ -55,7 +55,7 @@ fn context(doc: &mut Document, template: &str) -> Result<Context, SubplotError> fn tera(tmplspec: &TemplateSpec, templatename: &str) -> Result<Tera, SubplotError> { // Tera insists on a glob, but we want to load a specific template // only, so we use a glob that doesn't match anything. - let mut tera = Tera::new("/..IGNORE-THIS../..SUBPLOT-TERA-NOT-EXIST../*").expect("new"); + let mut tera = Tera::default(); tera.register_filter("base64", base64); tera.register_filter("nameslug", nameslug); tera.register_filter("commentsafe", commentsafe); |