From 3478395ca91413e007b06da600f4dba3370d197c Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Sat, 4 Feb 2017 11:19:47 +0100 Subject: Pass entire AST to code generator --- askama_derive/src/lib.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'askama_derive') diff --git a/askama_derive/src/lib.rs b/askama_derive/src/lib.rs index 37704b3..cdb0dd9 100644 --- a/askama_derive/src/lib.rs +++ b/askama_derive/src/lib.rs @@ -56,9 +56,8 @@ pub fn derive_template(input: TokenStream) -> TokenStream { _ => panic!("#[derive(Template)] can only be used with structs"), }; - let name = &ast.ident; let path = get_path_from_attrs(&ast.attrs); let src = get_template_source(&path); let tokens = askama::parser::parse(&src); - askama::generator::generate(name.as_ref(), &tokens).parse().unwrap() + askama::generator::generate(&ast, &tokens).parse().unwrap() } -- cgit