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/input.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 '')
-rw-r--r-- | askama_derive/src/input.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/askama_derive/src/input.rs b/askama_derive/src/input.rs index f46a3c3..d10fd7f 100644 --- a/askama_derive/src/input.rs +++ b/askama_derive/src/input.rs @@ -158,8 +158,8 @@ pub(crate) struct TemplateArgs { escaping: Option<String>, ext: Option<String>, syntax: Option<String>, - config: String, - whitespace: Option<String>, + config: Option<String>, + pub(crate) whitespace: Option<String>, } impl TemplateArgs { @@ -258,7 +258,7 @@ impl TemplateArgs { } } else if ident == "config" { if let syn::Lit::Str(s) = value.lit { - args.config = read_config_file(Some(&s.value()))?; + args.config = Some(s.value()); } else { return Err("config value must be string literal".into()); } @@ -276,8 +276,8 @@ impl TemplateArgs { Ok(args) } - pub(crate) fn config(&self) -> Result<Config<'_>, CompileError> { - Config::new(&self.config, self.whitespace.as_ref()) + pub(crate) fn config(&self) -> Result<String, CompileError> { + read_config_file(self.config.as_deref()) } } |