@@ -5,18 +5,18 @@ errors in a particular way. Generally speaking, error handling is divided into
55two broad categories: exceptions and return values. Rust opts for return
66values.
77
8- In this chapter , we intend to provide a comprehensive treatment of how to deal
8+ In this section , we intend to provide a comprehensive treatment of how to deal
99with errors in Rust. More than that, we will attempt to introduce error handling
1010one piece at a time so that you'll come away with a solid working knowledge of
1111how everything fits together.
1212
1313When done naïvely, error handling in Rust can be verbose and annoying. This
14- chapter will explore those stumbling blocks and demonstrate how to use the
14+ section will explore those stumbling blocks and demonstrate how to use the
1515standard library to make error handling concise and ergonomic.
1616
1717# Table of Contents
1818
19- This chapter is very long, mostly because we start at the very beginning with
19+ This section is very long, mostly because we start at the very beginning with
2020sum types and combinators, and try to motivate the way Rust does error handling
2121incrementally. As such, programmers with experience in other expressive type
2222systems may want to jump around.
@@ -636,7 +636,7 @@ Thus far, we've looked at error handling where everything was either an
636636` Option ` and a ` Result ` ? Or what if you have a ` Result<T, Error1> ` and a
637637` Result<T, Error2> ` ? Handling * composition of distinct error types* is the next
638638challenge in front of us, and it will be the major theme throughout the rest of
639- this chapter .
639+ this section .
640640
641641## Composing ` Option ` and ` Result `
642642
@@ -648,7 +648,7 @@ Of course, in real code, things aren't always as clean. Sometimes you have a
648648mix of ` Option ` and ` Result ` types. Must we resort to explicit case analysis,
649649or can we continue using combinators?
650650
651- For now, let's revisit one of the first examples in this chapter :
651+ For now, let's revisit one of the first examples in this section :
652652
653653``` rust,should_panic
654654use std::env;
@@ -1319,7 +1319,7 @@ and [`cause`](../std/error/trait.Error.html#method.cause), but the
13191319limitation remains: ` Box<Error> ` is opaque. (N.B. This isn't entirely
13201320true because Rust does have runtime reflection, which is useful in
13211321some scenarios that are [ beyond the scope of this
1322- chapter ] ( https://crates.io/crates/error ) .)
1322+ section ] ( https://crates.io/crates/error ) .)
13231323
13241324It's time to revisit our custom ` CliError ` type and tie everything together.
13251325
@@ -1486,7 +1486,7 @@ and [`fmt::Result`](../std/fmt/type.Result.html).
14861486
14871487# Case study: A program to read population data
14881488
1489- This chapter was long, and depending on your background, it might be
1489+ This section was long, and depending on your background, it might be
14901490rather dense. While there is plenty of example code to go along with
14911491the prose, most of it was specifically designed to be pedagogical. So,
14921492we're going to do something new: a case study.
@@ -1512,7 +1512,7 @@ and [`rustc-serialize`](https://crates.io/crates/rustc-serialize) crates.
15121512
15131513We're not going to spend a lot of time on setting up a project with
15141514Cargo because it is already covered well in [ the Cargo
1515- chapter ] ( ../book/hello-cargo.html ) and [ Cargo's documentation] [ 14 ] .
1515+ section ] ( ../book/hello-cargo.html ) and [ Cargo's documentation] [ 14 ] .
15161516
15171517To get started from scratch, run ` cargo new --bin city-pop ` and make sure your
15181518` Cargo.toml ` looks something like this:
@@ -2108,7 +2108,7 @@ handling.
21082108
21092109# The Short Story
21102110
2111- Since this chapter is long, it is useful to have a quick summary for error
2111+ Since this section is long, it is useful to have a quick summary for error
21122112handling in Rust. These are some good “rules of thumb." They are emphatically
21132113* not* commandments. There are probably good reasons to break every one of these
21142114heuristics!
0 commit comments