adnv 1.5.1

CLI that tracks, checks and auto-updates infrastructure dependency versions across Terraform, Helm, Docker, Git and npm
Documentation
1
2
3
4
5
6
7
8
9
10
11
use pest::{
    RuleType,
    iterators::{Pair, Pairs},
};

pub fn next_opt<'i, R: RuleType>(pairs: &mut Pairs<'i, R>, rule: R) -> Option<Pair<'i, R>> {
    match pairs.peek() {
        Some(pair) if pair.as_rule() == rule => pairs.next(),
        _ => None,
    }
}