Match tense and remove more repetition

This commit is contained in:
Carol (Nichols || Goulding)
2016-08-22 12:04:02 -04:00
parent bda3a6b1e9
commit e64048c6b8
+3 -4
View File
@@ -637,10 +637,9 @@ match guess.cmp(&secret_number) {
The `cmp()` method compares two values, and can be called on anything that can The `cmp()` method compares two values, and can be called on anything that can
be compared. It takes a reference to the thing you want to compare it to, so be compared. It takes a reference to the thing you want to compare it to, so
here it's comparing our `guess` to our `secret_number` and returning a variant here it's comparing our `guess` to our `secret_number`, and it returns a
of the `Ordering` enum. We use a [`match`][match] statement to decide what to variant of the `Ordering` enum. We use a [`match`][match] statement to decide
do next based on which variant of `Ordering` we got back from our call to what to do next based on which variant of `Ordering` we got back.
`cmp()` with the values in `guess` and `secret_number`.
[match]: match.html [match]: match.html