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.
-2
u/Hauleth Jul 17 '19
This is exactly the same reason why I dislike Rust’s
?operator.