aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--askama_derive/src/lib.rs2
-rw-r--r--askama_shared/src/generator.rs6
2 files changed, 4 insertions, 4 deletions
diff --git a/askama_derive/src/lib.rs b/askama_derive/src/lib.rs
index b2379f3..4e2a3af 100644
--- a/askama_derive/src/lib.rs
+++ b/askama_derive/src/lib.rs
@@ -65,7 +65,7 @@ fn build_template(ast: &syn::DeriveInput) -> Result<String, CompileError> {
eprintln!("{:?}", parsed[&input.path]);
}
- let code = generator::generate(&input, &contexts, &heritage, INTEGRATIONS)?;
+ let code = generator::generate(&input, &contexts, heritage.as_ref(), INTEGRATIONS)?;
if input.print == Print::Code || input.print == Print::All {
eprintln!("{}", code);
}
diff --git a/askama_shared/src/generator.rs b/askama_shared/src/generator.rs
index 72e2270..437331c 100644
--- a/askama_shared/src/generator.rs
+++ b/askama_shared/src/generator.rs
@@ -15,7 +15,7 @@ use std::{cmp, hash, mem, str};
pub fn generate<S: std::hash::BuildHasher>(
input: &TemplateInput<'_>,
contexts: &HashMap<&PathBuf, Context<'_>, S>,
- heritage: &Option<Heritage<'_>>,
+ heritage: Option<&Heritage<'_>>,
integrations: Integrations,
) -> Result<String, CompileError> {
Generator::new(input, contexts, heritage, integrations, MapChain::new())
@@ -28,7 +28,7 @@ struct Generator<'a, S: std::hash::BuildHasher> {
// All contexts, keyed by the package-relative template path
contexts: &'a HashMap<&'a PathBuf, Context<'a>, S>,
// The heritage contains references to blocks and their ancestry
- heritage: &'a Option<Heritage<'a>>,
+ heritage: Option<&'a Heritage<'a>>,
// What integrations need to be generated
integrations: Integrations,
// Variables accessible directly from the current scope (not redirected to context)
@@ -52,7 +52,7 @@ impl<'a, S: std::hash::BuildHasher> Generator<'a, S> {
fn new<'n>(
input: &'n TemplateInput<'_>,
contexts: &'n HashMap<&'n PathBuf, Context<'n>, S>,
- heritage: &'n Option<Heritage<'_>>,
+ heritage: Option<&'n Heritage<'_>>,
integrations: Integrations,
locals: MapChain<'n, &'n str, LocalMeta>,
) -> Generator<'n, S> {