aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2018-06-22 16:20:39 +0200
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2018-06-22 16:20:39 +0200
commit3219ed51e459b6c2980d5ba6ae589d2d9940dc2d (patch)
tree47abe8be42d9013982f1b2c3d30a6868d92fec3a
parent0889f86142e9cf86afd60da81041af4d2f94b70e (diff)
downloadaskama-3219ed51e459b6c2980d5ba6ae589d2d9940dc2d.tar.gz
askama-3219ed51e459b6c2980d5ba6ae589d2d9940dc2d.tar.bz2
askama-3219ed51e459b6c2980d5ba6ae589d2d9940dc2d.zip
Allow flattened types for inheriting templates
-rw-r--r--askama_derive/src/generator.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/askama_derive/src/generator.rs b/askama_derive/src/generator.rs
index 938d9dc..a81e6e4 100644
--- a/askama_derive/src/generator.rs
+++ b/askama_derive/src/generator.rs
@@ -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);