Find the items in a `@{a=b}`. We're only using annotations with tuples; we can consider formalizing this constraint.
(expr: pl::Expr)
| 183 | /// Find the items in a `@{a=b}`. We're only using annotations with tuples; |
| 184 | /// we can consider formalizing this constraint. |
| 185 | fn into_tuple_items(expr: pl::Expr) -> Result<Vec<(String, pl::ExprKind)>, pl::Expr> { |
| 186 | match expr.kind { |
| 187 | pl::ExprKind::Tuple(items) => items |
| 188 | .into_iter() |
| 189 | .map(|item| Ok((item.alias.clone().unwrap(), item.kind))) |
| 190 | .collect(), |
| 191 | _ => Err(expr), |
| 192 | } |
| 193 | } |
no test coverage detected