We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 293c55c commit ef039c5Copy full SHA for ef039c5
sqlx-macros-core/src/test_attr.rs
@@ -244,7 +244,19 @@ fn parse_args(attr_args: AttributeArgs) -> syn::Result<Args> {
244
));
245
}
246
247
- let Expr::Lit(syn::ExprLit { lit, .. }) = value.value else {
+ fn recurse_lit_lookup(expr: Expr) -> Option<Lit> {
248
+ match expr {
249
+ Expr::Lit(syn::ExprLit { lit, .. }) => {
250
+ return Some(lit);
251
+ }
252
+ Expr::Group(syn::ExprGroup { expr, .. }) => {
253
+ return recurse_lit_lookup(*expr);
254
255
+ _ => return None,
256
257
258
+
259
+ let Some(lit) = recurse_lit_lookup(value.value) else {
260
return Err(syn::Error::new_spanned(path, "expected string for `false`"));
261
};
262
0 commit comments