You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 with Option as well as with Result and the ? operator can return None to the surrounding function (if the return from that function is declared as Option<T> as well as Err (if the return is declared as Result).
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 an Option context or forward reference 9.3 (or a subsequent section) that documents ? in an Option context.