The compiler tells me that vvp_i_name
and vvp_j_name
match any value, but I can't figure out why.
vvp_i_name
and vvp_j_name
are type i32
, con.parm
is type std::vec::Vec<i32>
.
fn check(vvp_i: (Variable, i32), vvp_j: (Variable, i32), cc: &mut i32, csp: CSP) -> bool {
if vvp_i.0.neighbors.contains_key(&vvp_j.0.name) {
*cc += 1;
for x in vvp_i.0.neighbors.get(&vvp_j.0.name).unwrap() {
let con = csp.constraints.get(x).unwrap();
match con.mode {
Mode::Extension(ExtensionType::Supports) => {
if !con.tuples.contains(&(vvp_i.1, vvp_j.1)) {return false} //We can't return true till we cycle
} //through the entire for loop.
Mode::Extension(ExtensionType::Conflicts) => { //
if con.tuples.contains(&(vvp_i.1, vvp_j.1)) {return false} //
}
Mode::Intension => {
let vvp_i_name = vvp_i.0.name;
let vvp_j_name = vvp_j.0.name;
for y in con.parm {
match y {
vvp_i_name => {/*...Do stuff...*/}
vvp_j_name => {/*...Do stuff...*/}
_ => {}
}
}
}
}
}
}
true
}