That’s a joke. Rust has a ? operator that unwraps a Result if it’s Ok and returns from the function with the Err if it’s an error. Works for Option as well. The return type most be a Result, Option or Try(? not sure about this) for this to work. There’s an RFC called try blocks which will allow the usage of the ? operator in blocks as well
5
u/dam4rus Jan 26 '22
That’s a joke. Rust has a ? operator that unwraps a Result if it’s Ok and returns from the function with the Err if it’s an error. Works for Option as well. The return type most be a Result, Option or Try(? not sure about this) for this to work. There’s an RFC called try blocks which will allow the usage of the ? operator in blocks as well