Fix some formatting inconsistent with the doc

This commit is contained in:
Carol (Nichols || Goulding) 2016-10-14 22:53:51 -04:00
parent e2d63bcd6c
commit d92f03be9c
2 changed files with 10 additions and 10 deletions

View File

@ -646,8 +646,8 @@ number this time is 38. When the code compares 50 to 38, the `cmp` method will
return `Ordering::Greater`, because 50 is greater than 38. `Ordering::Greater`
is the value that the `match` expression gets. It looks at the first arms
pattern, `Ordering::Less`, but the value `Ordering::Greater` does not match
`Ordering::Les`s. So it ignores the code in that arm and moves to the next arm.
The next arms pattern, `Ordering::Greater`, **does** match
`Ordering::Less`. So it ignores the code in that arm and moves to the next arm.
The next arms pattern, `Ordering::Greater`, *does* match
`Ordering::Greater`! The associated code in that arm will execute and print
`Too big!` to the screen. The `match` expression ends because it has no need to
look at the last arm in this particular scenario.
@ -949,13 +949,13 @@ first arms pattern, and the `match` expression will just return the `num` val
that `parse` produced and put inside the `Ok` value. That number will end up
right where we want it in the new `guess` variable were creating.
If `parse` is not able to turn the string into a number, it will return an
If `parse` is *not* able to turn the string into a number, it will return an
`Err` value that contains more information about the error. The `Err` value
does not match the `Ok(num)` pattern in the first match arm, but it does match
does not match the `Ok(num)` pattern in the first `match` arm, but it does match
the `Err(_)` pattern in the second arm. The `_` is a catchall value; in this
example, were saying we want to match all `Err` values, no matter what
information they have inside them. So the program will execute the second arms
code, `continue`, which means to go to the next iteration of the loop and ask
code, `continue`, which means to go to the next iteration of the `loop` and ask
for another guess. So effectively, the program ignores all errors that `parse`
might encounter!

View File

@ -667,8 +667,8 @@ number this time is 38. When the code compares 50 to 38, the `cmp` method will
return `Ordering::Greater`, because 50 is greater than 38. `Ordering::Greater`
is the value that the `match` expression gets. It looks at the first arms
pattern, `Ordering::Less`, but the value `Ordering::Greater` does not match
`Ordering::Les`s. So it ignores the code in that arm and moves to the next arm.
The next arms pattern, `Ordering::Greater`, **does** match
`Ordering::Less`. So it ignores the code in that arm and moves to the next arm.
The next arms pattern, `Ordering::Greater`, *does* match
`Ordering::Greater`! The associated code in that arm will execute and print
`Too big!` to the screen. The `match` expression ends because it has no need to
look at the last arm in this particular scenario.
@ -972,13 +972,13 @@ first arms pattern, and the `match` expression will just return the `num` val
that `parse` produced and put inside the `Ok` value. That number will end up
right where we want it in the new `guess` variable were creating.
If `parse` is not able to turn the string into a number, it will return an
If `parse` is *not* able to turn the string into a number, it will return an
`Err` value that contains more information about the error. The `Err` value
does not match the `Ok(num)` pattern in the first match arm, but it does match
does not match the `Ok(num)` pattern in the first `match` arm, but it does match
the `Err(_)` pattern in the second arm. The `_` is a catchall value; in this
example, were saying we want to match all `Err` values, no matter what
information they have inside them. So the program will execute the second arms
code, `continue`, which means to go to the next iteration of the loop and ask
code, `continue`, which means to go to the next iteration of the `loop` and ask
for another guess. So effectively, the program ignores all errors that `parse`
might encounter!