4 ms·
Have a read of the rust release notes [0] to see why the ? operator actually improves code readability. It's not obvious from the simple example given the orig
by imron 10y ago
Have a read of the rust release notes [0] to see why the ? operator actually improves code readability.
It's not obvious from the simple example given the original article, but as the release notes mention it makes things like the following:
try!(try!(try!(foo()).bar()).baz())
much more readable:
foo()?.bar()?.baz()?
If the main concern is readability of code, the latter wins hand down.
0: https://blog.rust-lang.org/2016/11/10/Rust-1.13.html https://blog.rust-lang.org/2016/11/10/Rust-1.13.html