diff --git a/src/lib.rs b/src/lib.rs index 3537efa..e02bf03 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2,12 +2,12 @@ use roxy_core::roxy::Parse; #[derive(Debug)] pub struct TeraParser<'a> { - pub tera: tera::Tera, + pub tera: &'a mut tera::Tera, context: &'a tera::Context, } impl<'a> TeraParser<'a> { - pub fn new(tera: tera::Tera, context: &'a tera::Context) -> Self { + pub fn new(tera: &'a mut tera::Tera, context: &'a tera::Context) -> Self { Self { tera, context } } } @@ -26,7 +26,7 @@ impl<'a> Parse for TeraParser<'a> { .add_raw_template(path, template.as_str()) .map_err(err)?; - self.tera.render_to(path, &self.context, dst).map_err(err) + self.tera.render_to(path, self.context, dst).map_err(err) } }