pub(crate) fn expect_one_child(
message: &'static str,
pair: &Pair<'_, Rule>,
input_children: Vec<Box<Rel>>,
) -> Result<Box<Rel>, MessageParseError>
Expand description
This is a utility function for extracting a single child from the list of children, to be used in the RelationParsePair trait. The RelationParsePair trait passes a Vec of children, because some relations have multiple children - but most accept exactly one child.