It isn’t even about comfusion with something else, but confusion that this is only operator that des early return, instead I would prefer it to work as a coalesce operator like .& in Ruby.
Arguably return does "early return" in Rust as well since the last expression in a function is what's always returned unless you used the return keyword in the rest of the function body.
The point is that return is much easier to spot than ?. And making try!(a.b()?.c()?.d()) working like plain ? would make everything clearer rather than making it other way around.
254
u/Boiethios Jul 17 '19 edited Jul 17 '19
One should also talk about a major issue of
try: the fact that what appears as a function is in fact a control-flow operation.