Skip to content

Commit

Permalink
refine wording
Browse files Browse the repository at this point in the history
  • Loading branch information
bmusin authored Jan 11, 2018
1 parent 1adedab commit 28531c3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions first-edition/src/error-handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ fn main() {
}
```

This is a little better, but now we've written a lot more code! The case
This is a little better, but now we've written much more code! The case
analysis has once again bitten us.

Combinators to the rescue! Just like `Option`, `Result` has lots of combinators
Expand Down Expand Up @@ -815,7 +815,7 @@ type from `i32` to something else.
The first thing we need to decide: should we use `Option` or `Result`? We
certainly could use `Option` very easily. If any of the three errors occur, we
could simply return `None`. This will work *and it is better than panicking*,
but we can do a lot better. Instead, we should pass some detail about the error
but we can do much better. Instead, we should pass some detail about the error
that occurred. Since we want to express the *possibility of error*, we should
use `Result<i32, E>`. But what should `E` be? Since two *different* types of
errors can occur, we need to convert them to a common type. One such type is
Expand Down Expand Up @@ -1285,7 +1285,7 @@ macro_rules! try {
```

There's one tiny but powerful change: the error value is passed through
`From::from`. This makes the `try!` macro a lot more powerful because it gives
`From::from`. This makes the `try!` macro much more powerful because it gives
you automatic type conversion for free.

Armed with our more powerful `try!` macro, let's take a look at code we wrote
Expand Down

0 comments on commit 28531c3

Please sign in to comment.