Closed
Description
See the discussion in the following Reddit thread:
https://www.reddit.com/r/rust/comments/a4za5j/where_is_for_option_in_the_rfc_process/
Based on discussion, there is behavior released in Edition 2018 that is not documented in the Edition 2018 book, as well as behavior that is incorrectly documented:
- The
Try
trait and corresponding?
operator work withOption
as well as withResult
and the?
operator can returnNone
to the surrounding function (if the return from that function is declared asOption<T>
as well asErr
(if the return is declared asResult
). - Section 9.3 incorrectly states : "The ? operator can only be used in functions that have a return type of Result, because it is defined to work in the same way as the match expression we defined in Listing 9-6."
- Section 6.3 should either document
?
in anOption
context or forward reference 9.3 (or a subsequent section) that documents?
in anOption
context.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment