diff options
Diffstat (limited to '')
-rw-r--r-- | askama_derive/src/generator.rs | 2 | ||||
-rw-r--r-- | askama_derive/src/heritage.rs | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/askama_derive/src/generator.rs b/askama_derive/src/generator.rs index 5308c02..1c6e722 100644 --- a/askama_derive/src/generator.rs +++ b/askama_derive/src/generator.rs @@ -659,7 +659,7 @@ impl<'a> Generator<'a> { Node::Call(ws, scope, name, ref args) => { size_hint += self.write_call(ctx, buf, ws, scope, name, args)?; } - Node::Macro(_, ref m) => { + Node::Macro(ref m) => { if level != AstLevel::Top { return Err("macro blocks only allowed at the top level".into()); } diff --git a/askama_derive/src/heritage.rs b/askama_derive/src/heritage.rs index 9ef7aeb..801b109 100644 --- a/askama_derive/src/heritage.rs +++ b/askama_derive/src/heritage.rs @@ -64,14 +64,14 @@ impl Context<'_> { extends = Some(config.find_template(extends_path, Some(path))?); } }, - Node::Macro(name, m) if top => { - macros.insert(*name, m); + Node::Macro(m) if top => { + macros.insert(m.name, m); } Node::Import(_, import_path, scope) if top => { let path = config.find_template(import_path, Some(path))?; imports.insert(*scope, path); } - Node::Extends(_) | Node::Macro(_, _) | Node::Import(_, _, _) if !top => { + Node::Extends(_) | Node::Macro(_) | Node::Import(_, _, _) if !top => { return Err( "extends, macro or import blocks not allowed below top level".into(), ); |