aboutsummaryrefslogtreecommitdiffstats
path: root/askama_shared
diff options
context:
space:
mode:
authorLibravatar René Kijewski <kijewski@library.vetmed.fu-berlin.de>2022-01-12 16:21:14 +0100
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2022-01-12 16:57:48 +0100
commit48c1bf7d192cc5d2e423eb3036cc172297fc8dc3 (patch)
tree1bb6012a4432f9bd09ac5238919c7a5a942b052e /askama_shared
parent8a05c16271e0ee7d8017a46d8d3423027f8ae57c (diff)
downloadaskama-48c1bf7d192cc5d2e423eb3036cc172297fc8dc3.tar.gz
askama-48c1bf7d192cc5d2e423eb3036cc172297fc8dc3.tar.bz2
askama-48c1bf7d192cc5d2e423eb3036cc172297fc8dc3.zip
`&Option<T>` → `Option<&T>`
Diffstat (limited to 'askama_shared')
-rw-r--r--askama_shared/src/generator.rs6
1 files changed, 3 insertions, 3 deletions
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> {