From 874e0350335de3049c6cddc10bc371b11958e79c Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Mon, 20 Mar 2023 16:01:36 +0100 Subject: Extract literal from group expressions in attributes --- askama_derive/src/generator.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'askama_derive/src') 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()), }; -- cgit