aboutsummaryrefslogtreecommitdiffstats
path: root/askama_derive/src/lib.rs
diff options
context:
space:
mode:
authorLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2023-10-06 12:06:17 +0200
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2023-11-01 12:52:09 +0100
commit2a4d58cbb2033114890415c98a61e730185d1f83 (patch)
treebb76360721ee18bd3c40a4deba925743711fbac2 /askama_derive/src/lib.rs
parenta057f81c051ae71329c5377b0351e6a09231c30d (diff)
downloadaskama-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.rs7
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)?;