diff options
author | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2018-06-21 14:08:33 +0200 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2018-06-21 14:08:33 +0200 |
commit | 959f5e1333effbbf52a1e2e91a7f31ee303e5cbe (patch) | |
tree | 1c880e9d7c82841da1e97db0a1919ddec63f13bb /askama_derive/src/generator.rs | |
parent | 2a6dce31eaa9efb505cc19b0fbdfe155132c4c07 (diff) | |
download | askama-959f5e1333effbbf52a1e2e91a7f31ee303e5cbe.tar.gz askama-959f5e1333effbbf52a1e2e91a7f31ee303e5cbe.tar.bz2 askama-959f5e1333effbbf52a1e2e91a7f31ee303e5cbe.zip |
Store extends path in Context
Diffstat (limited to 'askama_derive/src/generator.rs')
-rw-r--r-- | askama_derive/src/generator.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/askama_derive/src/generator.rs b/askama_derive/src/generator.rs index 884ab3e..5d16f2c 100644 --- a/askama_derive/src/generator.rs +++ b/askama_derive/src/generator.rs @@ -58,7 +58,7 @@ impl<'a> Generator<'a> { // Takes a Context and generates the relevant implementations. fn build(mut self, ctx: &'a Context) -> String { if !ctx.blocks.is_empty() { - if !ctx.derived { + if ctx.extends.is_none() { self.define_trait(ctx); } else { let parent_type = get_parent_type(self.input.ast) @@ -66,7 +66,7 @@ impl<'a> Generator<'a> { self.deref_to_parent(parent_type); } - let trait_nodes = if !ctx.derived { + let trait_nodes = if ctx.extends.is_none() { Some(&ctx.nodes[..]) } else { None @@ -156,7 +156,7 @@ impl<'a> Generator<'a> { "fn render_into(&self, writer: &mut ::std::fmt::Write) \ -> ::askama::Result<()> {", ); - if ctx.derived { + if ctx.extends.is_some() { self.writeln("self._parent.render_trait_into(self, writer)"); } else { self.writeln("self.render_trait_into(self, writer)"); |