| ▲ | jeroenhd 2 days ago | |
The same pattern can also be useful in Rust for early returning Result<_,_> errors (you cannot `let x = foo()?` inside of a normal block like that).
would fail to compile, or worse: would return out of the entire method if surrounding method would have return type Result<_,i32>. On the other hand,
runs just fine.Hopefully try blocks will allow using ? inside of expression blocks in the future, though. | ||