Skip to content

Commit

Permalink
Merge pull request rust-lang#1108 from bmusin/patch-4
Browse files Browse the repository at this point in the history
refine wording
  • Loading branch information
carols10cents authored Jan 12, 2018
2 parents d75460f + 28531c3 commit af9784a
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 af9784a

Please sign in to comment.