Lift a `:::constraint` container into a `Constraint`.
(d: &Directive, human_key: &str, n: usize)
| 197 | |
| 198 | /// Lift a `:::constraint` container into a `Constraint`. |
| 199 | fn lift_constraint(d: &Directive, human_key: &str, n: usize) -> Constraint { |
| 200 | let local = |
| 201 | d.id.clone() |
| 202 | .unwrap_or_else(|| format!("{}-constraint-{n}", slug(human_key))); |
| 203 | Constraint { |
| 204 | type_: NodeType::Constraint.as_str().to_string(), |
| 205 | id: as_urn("constraint", &local), |
| 206 | text: d.body.clone(), |
| 207 | } |
| 208 | } |
| 209 | |
| 210 | /// Lift a `:::ref{to= edge=}` leaf into a typed dependency edge. Both `to` and |
| 211 | /// `edge` are required (a dependency with no target or no edge type is a lift |
no test coverage detected