Lift a `:::constraint` container into a `Constraint`.
(d: &Directive, id_base: &str, n: usize)
| 214 | |
| 215 | /// Lift a `:::constraint` container into a `Constraint`. |
| 216 | fn lift_constraint(d: &Directive, id_base: &str, n: usize) -> Constraint { |
| 217 | let local = |
| 218 | d.id.clone() |
| 219 | .unwrap_or_else(|| format!("{}-constraint-{n}", slug(id_base))); |
| 220 | Constraint { |
| 221 | type_: NodeType::Constraint.as_str().to_string(), |
| 222 | id: as_urn("constraint", &local), |
| 223 | text: d.body.clone(), |
| 224 | } |
| 225 | } |
| 226 | |
| 227 | /// Lift a `:::ref{to= edge=}` leaf into a typed dependency edge. Both `to` and |
| 228 | /// `edge` are required (a dependency with no target or no edge type is a lift |
no test coverage detected