Don't say "in this case" 3x in one paragraph :(

This commit is contained in:
Carol (Nichols || Goulding)
2016-09-16 10:23:46 -04:00
parent 9e7feab745
commit 94081a235a
+10 -10
View File
@@ -265,16 +265,16 @@ successful, and inside the `Ok` variant is the successfully generated value.
or why the operation failed. or why the operation failed.
The purpose of these `Result` types is to encode error handling information. The purpose of these `Result` types is to encode error handling information.
Values of the `Result` type, like any type, have methods defined on them. In Values of the `Result` type, like any type, have methods defined on them.
this case, `io::Result` has an [`expect` method][expect]<!-- ignore --> that `io::Result` has an [`expect` method][expect]<!-- ignore --> that we can call.
we can call. If this instance of `io::Result` is an `Err` value, `expect` If this instance of `io::Result` is an `Err` value, `expect` will cause our
will cause our program to crash and display the message that we passed as an program to crash and display the message that we passed as an argument to
argument to `expect`. In this case, if the `read_line` method returns an `expect`. If the `read_line` method returns an `Err`, it would likely be the
`Err`, it would likely be the result of an error coming from the underlying result of an error coming from the underlying operating system. If this
operating system. If this instance of `io::Result` is an `Ok` value, `expect` instance of `io::Result` is an `Ok` value, `expect` will take the return value
will take the return value that `Ok` is holding and return just that value to that `Ok` is holding and return just that value to us so that we could use it.
us so that we can use it. In this case, that value is the number of In this case, that value is the number of characters the user entered into
characters the user entered into standard input. standard input.
[expect]: ../std/result/enum.Result.html#method.expect [expect]: ../std/result/enum.Result.html#method.expect