fn compare_loop()

in guard/src/rules/evaluate.rs [105:135]


fn compare_loop<F>(lhs: &Vec<&PathAwareValue>, rhs: &Vec<&PathAwareValue>, compare: F, any_one_rhs: bool, atleast_one: bool)
    -> Result<(bool, Vec<(bool, Option<PathAwareValue>, Option<PathAwareValue>)>)>
    where F: Fn(&PathAwareValue, &PathAwareValue) -> Result<bool> {
    let (overall, results) = compare_loop_all(lhs, rhs, compare, any_one_rhs)?;
    let overall = 'outer: loop {
        if !overall {
            for (each, _, _) in results.iter() {
                if atleast_one {
                    if *each {
                        break 'outer true
                    }
                }
                else {
                    if !*each {
                        break 'outer false
                    }
                }
            }
            if atleast_one {
                break 'outer false
            }
            else {
                break 'outer true
            }
        }
        else {
            break true
        }
    };
    Ok((overall, results))
}