diff options
author | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2023-12-18 11:51:37 +0100 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2023-12-18 12:01:35 +0100 |
commit | 1b1ab5e1b94c136d3cd057f8214623a40e707e5f (patch) | |
tree | 183cba85b8f0dca9175832ee930e661de76b94c4 /askama_derive/src/lib.rs | |
parent | 25bf3e945c0ddfa995390b82e177016cb49b947f (diff) | |
download | askama-1b1ab5e1b94c136d3cd057f8214623a40e707e5f.tar.gz askama-1b1ab5e1b94c136d3cd057f8214623a40e707e5f.tar.bz2 askama-1b1ab5e1b94c136d3cd057f8214623a40e707e5f.zip |
Unbreak reading config from default location
I broke this in 2a4d58cbb2033114890415c98a61e730185d1f83 due to
refactoring for better internal abstractions in askama_derive.
We also don't currently have any tests for the default config path.
Diffstat (limited to 'askama_derive/src/lib.rs')
-rw-r--r-- | askama_derive/src/lib.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/askama_derive/src/lib.rs b/askama_derive/src/lib.rs index 547a449..f9f3d41 100644 --- a/askama_derive/src/lib.rs +++ b/askama_derive/src/lib.rs @@ -10,6 +10,7 @@ use proc_macro2::Span; use parser::ParseError; mod config; +use config::Config; mod generator; use generator::{Generator, MapChain}; mod heritage; @@ -35,7 +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 = template_args.config()?; + let toml = template_args.config()?; + let config = Config::new(&toml, template_args.whitespace.as_ref())?; let input = TemplateInput::new(ast, &config, &template_args)?; let mut templates = HashMap::new(); |