diff options
author | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2017-02-04 11:19:47 +0100 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2017-02-04 11:19:47 +0100 |
commit | 3478395ca91413e007b06da600f4dba3370d197c (patch) | |
tree | 64f6f27fc83457f41c4907c8229bc9b991794b41 /askama_derive/src | |
parent | 69238e55d3fe8ff6b8eff58d3cd96b99eb886617 (diff) | |
download | askama-3478395ca91413e007b06da600f4dba3370d197c.tar.gz askama-3478395ca91413e007b06da600f4dba3370d197c.tar.bz2 askama-3478395ca91413e007b06da600f4dba3370d197c.zip |
Pass entire AST to code generator
Diffstat (limited to '')
-rw-r--r-- | askama_derive/src/lib.rs | 3 |
1 files changed, 1 insertions, 2 deletions
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() } |