Skip to content

Commit

Permalink
clarify description of when ? can be used
Browse files Browse the repository at this point in the history
  • Loading branch information
mtorp committed Oct 4, 2020
1 parent cb28dee commit 73a1e38
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 73a1e38

Please sign in to comment.