From 3219ed51e459b6c2980d5ba6ae589d2d9940dc2d Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Fri, 22 Jun 2018 16:20:39 +0200 Subject: Allow flattened types for inheriting templates --- askama_derive/src/generator.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'askama_derive/src') 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); -- cgit