Skip to content

Commit

Permalink
Fix incorrect statement about ok()
Browse files Browse the repository at this point in the history
Fixes #17676.
  • Loading branch information
steveklabnik committed Oct 1, 2014
1 parent e2357cf commit dc35a53
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/doc/guide.md
Expand Up @@ -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.
Expand Down

0 comments on commit dc35a53

Please sign in to comment.