We have:
o_func : Option<Rc<dyn Fn(..)>>
To use it, I end up doing:
if let Some(func) = &o_func {
(fun)(...)
}
This ends up turning something that should be one line into three lines, and two of the lines are noise. Is there a way to simplify this? (I'm dealing with GUI objects that can have 5-10 of these optional handlers, so this turns out to be quite repetitive.)
EDIT: changed o_func
to &o_func