fn apply_rule<'a>(signals: &mut HashMap<&'a str, u64>, rule: &Rule<'a>) -> bool {
    match rule {
        Rule::Unary(input_value, op, out) => {
            match apply_value(signals, input_value) {
                Some(inp) => signals.insert(out, apply_unary(inp, op)),
                None => return false
            };
        },
        Rule::Binary(lhs_value, rhs_value, op, out) => {
            match apply_value(signals, lhs_value) {
                Some(lhs) => match apply_value(signals, rhs_value) {
                    Some(rhs) => signals.insert(out, apply_binary(lhs, rhs, op)),
                    None => return false
                },
                None => return false
            };
        }
    }
    true
}
// Returns if the rule was successfully executed
Returns if the rule was successfully executed
Returns if the rule was successfully executed
fn apply_rule<'a>(signals: &mut HashMap<&'a str, u64>, rule: &Rule<'a>) -> bool {
    match rule {
        Rule::Unary(input_value, op, out) => {
            match apply_value(signals, input_value) {
                Some(inp) => signals.insert(out, apply_unary(inp, op)),
                None => return false
            };
        },
        Rule::Binary(lhs_value, rhs_value, op, out) => {
            match apply_value(signals, lhs_value) {
                Some(lhs) => match apply_value(signals, rhs_value) {
                    Some(rhs) => signals.insert(out, apply_binary(lhs, rhs, op)),
                    None => return false
                },
                None => return false
            };
        }
    }
    true
}
fn apply_rule < ' a > ( signals : & mut HashMap < & ' a str , u64 > , rule : & Rule < ' a > ) -> bool { match rule { Rule :: Unary ( input_value , op , out ) => { match apply_value ( signals , input_value ) { Some ( inp ) => signals . insert ( out , apply_unary ( inp , op ) ) , None => return false } ; } , Rule :: Binary ( lhs_value , rhs_value , op , out ) => { match apply_value ( signals , lhs_value ) { Some ( lhs ) => match apply_value ( signals , rhs_value ) { Some ( rhs ) => signals . insert ( out , apply_binary ( lhs , rhs , op ) ) , None => return false } , None => return false } ; } } true }
Returns if the rule was successfully executed
Returns if the rule was successfully executed
signals
&mut HashMap<&'a str, u64>
rule
&Rule<'a>