Skip to content

Commit

Permalink
Rollup merge of rust-lang#29567 - Toby-S:patch-1, r=steveklabnik
Browse files Browse the repository at this point in the history
Reword "Writing the logic" paragraph to prevent `unwrap` being confused for a macro (and other small changes to improve the flow of the paragraph).

cc @steveklabnik
  • Loading branch information
steveklabnik committed Nov 5, 2015
2 parents 444e8d6 + 6fb2333 commit 92eb851
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/doc/trpl/error-handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -1605,14 +1605,11 @@ arguments.

## Writing the logic

We're all different in how we write code, but error handling is
usually the last thing we want to think about. This isn't very good
practice for good design, but it can be useful for rapidly
prototyping. In our case, because Rust forces us to be explicit about
error handling, it will also make it obvious what parts of our program
can cause errors. Why? Because Rust will make us call `unwrap`! This
can give us a nice bird's eye view of how we need to approach error
handling.
We all write code differently, but error handling is usually the last thing we
want to think about. This isn't great for the overall design of a program, but
it can be useful for rapid prototyping. Because Rust forces us to be explicit
about error handling (by making us call `unwrap`), it is easy to see which
parts of our program can cause errors.

In this case study, the logic is really simple. All we need to do is parse the
CSV data given to us and print out a field in matching rows. Let's do it. (Make
Expand Down

0 comments on commit 92eb851

Please sign in to comment.