diff options
| author | Steve Klabnik <steve@steveklabnik.com> | 2014-10-01 17:16:34 -0400 |
|---|---|---|
| committer | Steve Klabnik <steve@steveklabnik.com> | 2014-10-01 17:16:34 -0400 |
| commit | dc35a53d15527e5618d9531b4452bae857f60169 (patch) | |
| tree | bdc2d26b853fb1949ad8bd9522554565329535f0 | |
| parent | e2357cf41b69c6db57bbf53c63f59376576c72ae (diff) | |
| download | rust-dc35a53d15527e5618d9531b4452bae857f60169.tar.gz rust-dc35a53d15527e5618d9531b4452bae857f60169.zip | |
Fix incorrect statement about ok()
Fixes #17676.
| -rw-r--r-- | src/doc/guide.md | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/doc/guide.md b/src/doc/guide.md index 30bb48ffccb..3ffb7cad0a4 100644 --- a/src/doc/guide.md +++ b/src/doc/guide.md @@ -1678,11 +1678,11 @@ just `int`s. Rust provides a method on these `IoResult<T>`s called `ok()`, which does the same thing as our `match` statement, but assuming that we have a valid value. -If we don't, it will terminate our program. In this case, if we can't get -input, our program doesn't work, so we're okay with that. In most cases, we -would want to handle the error case explicitly. The result of `ok()` has a -method, `expect()`, which allows us to give an error message if this crash -happens. +We then call `expect()` on the result, which will terminate our program if we +don't have a valid value. In this case, if we can't get input, our program +doesn't work, so we're okay with that. In most cases, we would want to handle +the error case explicitly. `expect()` allows us to give an error message if +this crash happens. We will cover the exact details of how all of this works later in the Guide. For now, this gives you enough of a basic understanding to work with. |
