diff options
author | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2023-10-06 12:06:17 +0200 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2023-11-01 12:52:09 +0100 |
commit | 2a4d58cbb2033114890415c98a61e730185d1f83 (patch) | |
tree | bb76360721ee18bd3c40a4deba925743711fbac2 /askama_derive/src/lib.rs | |
parent | a057f81c051ae71329c5377b0351e6a09231c30d (diff) | |
download | askama-2a4d58cbb2033114890415c98a61e730185d1f83.tar.gz askama-2a4d58cbb2033114890415c98a61e730185d1f83.tar.bz2 askama-2a4d58cbb2033114890415c98a61e730185d1f83.zip |
Reorganize TemplateArgs and TemplateInput structure
Diffstat (limited to 'askama_derive/src/lib.rs')
-rw-r--r-- | askama_derive/src/lib.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/askama_derive/src/lib.rs b/askama_derive/src/lib.rs index 3046f9d..a133813 100644 --- a/askama_derive/src/lib.rs +++ b/askama_derive/src/lib.rs @@ -10,7 +10,7 @@ use proc_macro2::Span; use parser::ParseError; mod config; -use config::{read_config_file, Config}; +use config::Config; mod generator; use generator::{Generator, MapChain}; mod heritage; @@ -36,9 +36,8 @@ pub fn derive_template(input: TokenStream) -> TokenStream { /// value as passed to the `template()` attribute. pub(crate) fn build_template(ast: &syn::DeriveInput) -> Result<String, CompileError> { let template_args = TemplateArgs::new(ast)?; - let config_toml = read_config_file(template_args.config_path.as_deref())?; - let config = Config::new(&config_toml, template_args.whitespace.as_ref())?; - let input = TemplateInput::new(ast, &config, template_args)?; + let config = Config::new(&template_args.config, template_args.whitespace.as_ref())?; + let input = TemplateInput::new(ast, &config, &template_args)?; let mut templates = HashMap::new(); input.find_used_templates(&mut templates)?; |