mirror of
https://github.com/askama-rs/askama.git
synced 2025-10-01 15:00:57 +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.
|
||||
fn build(mut self, ctx: &'a Context) -> String {
|
||||
let heritage = if !ctx.blocks.is_empty() {
|
||||
if ctx.extends.is_some() && self.input.parent.is_none() {
|
||||
panic!("expected field '_parent' in extending template struct");
|
||||
} else if let Some(parent) = self.input.parent {
|
||||
if let Some(parent) = self.input.parent {
|
||||
self.deref_to_parent(parent);
|
||||
}
|
||||
let heritage = Heritage::new(ctx, self.contexts);
|
||||
|
Loading…
x
Reference in New Issue
Block a user