while let unwrap_group

This commit is contained in:
David Hewitt 2021-06-24 09:11:27 +01:00
parent 08802e2024
commit 67948a24f7

View file

@ -118,9 +118,9 @@ pub fn ensure_not_async_fn(sig: &syn::Signature) -> syn::Result<()> {
Ok(()) Ok(())
} }
pub fn unwrap_group(expr: &syn::Expr) -> &syn::Expr { pub fn unwrap_group(mut expr: &syn::Expr) -> &syn::Expr {
match expr { while let syn::Expr::Group(g) = expr {
syn::Expr::Group(syn::ExprGroup { expr, .. }) => &*expr, expr = &*g.expr;
other => other,
} }
expr
} }