aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2023-03-20 16:01:36 +0100
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2023-03-21 10:35:31 +0100
commit874e0350335de3049c6cddc10bc371b11958e79c (patch)
tree045bdebb2d726a61bce784077870342b3c5776bb
parent73eaf50ee836db6577141b9a2ea0a3c8ab568eb4 (diff)
downloadaskama-874e0350335de3049c6cddc10bc371b11958e79c.tar.gz
askama-874e0350335de3049c6cddc10bc371b11958e79c.tar.bz2
askama-874e0350335de3049c6cddc10bc371b11958e79c.zip
Extract literal from group expressions in attributes
-rw-r--r--askama_derive/src/generator.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/askama_derive/src/generator.rs b/askama_derive/src/generator.rs
index 6637698..05b3fc3 100644
--- a/askama_derive/src/generator.rs
+++ b/askama_derive/src/generator.rs
@@ -130,6 +130,12 @@ impl TemplateArgs {
let value = match pair.value {
syn::Expr::Lit(lit) => lit,
+ syn::Expr::Group(group) => match *group.expr {
+ syn::Expr::Lit(lit) => lit,
+ _ => {
+ return Err(format!("unsupported argument value type for {ident:?}").into())
+ }
+ },
_ => return Err(format!("unsupported argument value type for {ident:?}").into()),
};