I have a bunch of nested loops where I look-up for the existence of elements in collections. The lookup functions all return Option<T>. If it is a None, I will continue the inner loop. But this is making the code too far indented.
for t1 in t1_coll.iter() {
if let Some(t1_property) = t1.get_property() {
for t2 in t2_coll.iter() {
}
} else {
continue
}
What would be the idiomatic way to structure this? Is something like this possible, or is this a bad idea? Note that there is no "default" for the property.
let t1_property = t1.get_property().unwrap_or_continue()