mirror of
https://github.com/askama-rs/askama.git
synced 2025-10-03 07:45:14 +00:00
Allow flattened types for inheriting templates
This commit is contained in:
parent
0889f86142
commit
3219ed51e4
@ -57,9 +57,7 @@ impl<'a> Generator<'a> {
|
|||||||
// Takes a Context and generates the relevant implementations.
|
// Takes a Context and generates the relevant implementations.
|
||||||
fn build(mut self, ctx: &'a Context) -> String {
|
fn build(mut self, ctx: &'a Context) -> String {
|
||||||
let heritage = if !ctx.blocks.is_empty() {
|
let heritage = if !ctx.blocks.is_empty() {
|
||||||
if ctx.extends.is_some() && self.input.parent.is_none() {
|
if let Some(parent) = self.input.parent {
|
||||||
panic!("expected field '_parent' in extending template struct");
|
|
||||||
} else if let Some(parent) = self.input.parent {
|
|
||||||
self.deref_to_parent(parent);
|
self.deref_to_parent(parent);
|
||||||
}
|
}
|
||||||
let heritage = Heritage::new(ctx, self.contexts);
|
let heritage = Heritage::new(ctx, self.contexts);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user