diff options
Diffstat (limited to 'askama_shared')
-rw-r--r-- | askama_shared/src/lib.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/askama_shared/src/lib.rs b/askama_shared/src/lib.rs index a7deaff..2feff75 100644 --- a/askama_shared/src/lib.rs +++ b/askama_shared/src/lib.rs @@ -38,11 +38,10 @@ pub fn build_template(ast: &syn::DeriveInput) -> String { let data = input::TemplateInput::new(ast); let nodes = parser::parse(data.source.as_ref()); let imports = Imports::new(&nodes, &data.path); - let imported = imports.parse(); if data.meta.print == Print::Ast || data.meta.print == Print::All { println!("{:?}", nodes); } - let code = generator::generate(&data, &nodes, &imported); + let code = generator::generate(&data, &nodes, &imports.macro_map()); if data.meta.print == Print::Code || data.meta.print == Print::All { println!("{}", code); } @@ -66,9 +65,7 @@ impl <'a> Imports<'a> { _ => None, } }).collect(); - Imports { - sources, - } + Imports { sources } } pub fn parse(&'a self) -> HashMap<&'a str, Macro<'a>> { |