Is the question mark operator ? equivalent to the

2019-01-26 03:33发布

I am looking for a way to chain the usage of the try! macro in Rust and found this pull request that implements the ? operator.

It seems like it has been merged, but I cannot seem to find any documentation on it yet. Is it equivalent to the try! macro or are there important differences?

1条回答
三岁会撩人
2楼-- · 2019-01-26 04:12

Yes, the ? operator is equivalent to try!(). ? is now in stable Rust 1.13, released on November 10, 2016.

The best source of documentation at the moment seems to be RFC 0243. Note that the catch described in the RFC is not yet implemented at this writing (issue).

查看更多
登录 后发表回答