Merge branch 'main' into dev

main
Ziyang Hu 2 years ago
commit 7bb09a27c0

@ -302,6 +302,9 @@ impl MagicFixedRuleApply {
);
Ok(rel)
}
pub(crate) fn relations_count(&self) -> usize {
self.rule_args.len()
}
pub(crate) fn relation(&self, idx: usize) -> Result<&MagicFixedRuleRuleArg> {
#[derive(Error, Diagnostic, Debug)]
#[error("Cannot find a required positional argument at index {idx} for '{rule_name}'")]

@ -329,6 +329,10 @@ impl<'a, 'b> FixedRuleInputRelation<'a, 'b> {
}
impl<'a, 'b> FixedRulePayload<'a, 'b> {
/// Get the total number of input relations.
pub fn inputs_count(&self) -> usize {
self.manifest.relations_count()
}
/// Get the input relation at `idx`.
pub fn get_input(&self, idx: usize) -> Result<FixedRuleInputRelation<'a, 'b>> {
let arg_manifest = self.manifest.relation(idx)?;

@ -7,6 +7,14 @@
"created_at": "2023-01-30T23:11:47Z",
"repoId": 551374215,
"pullRequestNo": 38
},
{
"name": "GoldsteinE",
"id": 12019211,
"comment_id": 1412614986,
"created_at": "2023-02-01T19:34:43Z",
"repoId": 551374215,
"pullRequestNo": 39
}
]
}
Loading…
Cancel
Save