Skip to content

Commit

Permalink
Merge pull request #2471 from mtorp/master
Browse files Browse the repository at this point in the history
clarify description of when ? can be used
  • Loading branch information
steveklabnik authored Oct 5, 2020
2 parents cb28dee + 73a1e38 commit 451a1e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ch09-02-recoverable-errors-with-result.md
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ The `?` operator can 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. The part of the `match` that requires a
return type of `Result` is `return Err(e)`, so the return type of the function
can be a `Result` to be compatible with this `return`.
has to be a `Result` to be compatible with this `return`.

Let’s look at what happens if we use the `?` operator in the `main` function,
which you’ll recall has a return type of `()`:
Expand Down

0 comments on commit 451a1e3

Please sign in to comment.