Skip to content

Commit 0418a43

Browse files
committed
Auto merge of #28541 - baskerville:trpl-two-typos, r=steveklabnik
r? @steveklabnik
2 parents b7f49ca + 856f97a commit 0418a43

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/doc/trpl/error-handling.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ fn find(haystack: &str, needle: char) -> Option<usize> {
154154
}
155155
```
156156

157-
Notice that when this function finds a matching character, it doen't just
157+
Notice that when this function finds a matching character, it doesn't just
158158
return the `offset`. Instead, it returns `Some(offset)`. `Some` is a variant or
159159
a *value constructor* for the `Option` type. You can think of it as a function
160160
with the type `fn<T>(value: T) -> Option<T>`. Correspondingly, `None` is also a
@@ -840,7 +840,7 @@ example, the very last call to `map` multiplies the `Ok(...)` value (which is
840840
an `i32`) by `2`. If an error had occurred before that point, this operation
841841
would have been skipped because of how `map` is defined.
842842

843-
`map_err` is the trick the makes all of this work. `map_err` is just like
843+
`map_err` is the trick that makes all of this work. `map_err` is just like
844844
`map`, except it applies a function to the `Err(...)` value of a `Result`. In
845845
this case, we want to convert all of our errors to one type: `String`. Since
846846
both `io::Error` and `num::ParseIntError` implement `ToString`, we can call the

0 commit comments

Comments
 (0)