What is the idiomatic way to do something when an Option is either None, or the inner value meets some condition?
// in None case // │ in Some(_) case // ┌┴─┐ ┌───────────────────┐ if foo.map_or(true, |foo_val| foo_val < 5) { // … } For more information see Option::map_or.