From dc35a53d15527e5618d9531b4452bae857f60169 Mon Sep 17 00:00:00 2001 From: Steve Klabnik Date: Wed, 1 Oct 2014 17:16:34 -0400 Subject: [PATCH] Fix incorrect statement about ok() Fixes #17676. --- src/doc/guide.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/doc/guide.md b/src/doc/guide.md index 30bb48ffccbf..3ffb7cad0a4c 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`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.