From a057f81c051ae71329c5377b0351e6a09231c30d Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Fri, 6 Oct 2023 11:53:05 +0200 Subject: Inline some logic into find_used_templates() --- askama_derive/src/lib.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'askama_derive/src/lib.rs') diff --git a/askama_derive/src/lib.rs b/askama_derive/src/lib.rs index 37e8a3b..3046f9d 100644 --- a/askama_derive/src/lib.rs +++ b/askama_derive/src/lib.rs @@ -10,13 +10,13 @@ use proc_macro2::Span; use parser::ParseError; mod config; -use config::{get_template_source, read_config_file, Config}; +use config::{read_config_file, Config}; mod generator; use generator::{Generator, MapChain}; mod heritage; use heritage::{Context, Heritage}; mod input; -use input::{Print, Source, TemplateArgs, TemplateInput}; +use input::{Print, TemplateArgs, TemplateInput}; #[proc_macro_derive(Template, attributes(template))] pub fn derive_template(input: TokenStream) -> TokenStream { @@ -39,13 +39,9 @@ pub(crate) fn build_template(ast: &syn::DeriveInput) -> Result s.clone(), - Source::Path(_) => get_template_source(&input.path)?, - }; let mut templates = HashMap::new(); - input.find_used_templates(&mut templates, source)?; + input.find_used_templates(&mut templates)?; let mut contexts = HashMap::new(); for (path, parsed) in &templates { -- cgit