How could i pattern match those 4 coordinates in the for loop?
use itertools::Itertools;
fn main() {
let nodes: Vec<(u8, u8)> = vec![(1, 2), (3, 4), (5, 6)];
let nodes_pairs = nodes
.into_iter()
.combinations(2);
for pair in nodes_pairs {
// TODO: there *must* be a better way to achieve this:
let (v1, v2) = (pair[0], pair[1]);
let (i1, j1) = (v1.0, v1.1);
let (i2, j2) = (v2.0, v2.1);
println!("({i1}, {j1}), ({i2}, {j2})");
}
}