(
annotation: &mut Vec<(String, pl::ExprKind)>,
name: &str,
)
| 170 | } |
| 171 | |
| 172 | fn pluck_annotation( |
| 173 | annotation: &mut Vec<(String, pl::ExprKind)>, |
| 174 | name: &str, |
| 175 | ) -> Option<pl::Literal> { |
| 176 | annotation |
| 177 | .pluck(|(n, val)| if n == name { Ok(val) } else { Err((n, val)) }) |
| 178 | .into_iter() |
| 179 | .next() |
| 180 | .and_then(|val| val.into_literal().ok()) |
| 181 | } |
| 182 | |
| 183 | /// Find the items in a `@{a=b}`. We're only using annotations with tuples; |
| 184 | /// we can consider formalizing this constraint. |
no test coverage detected