Skip to content

Commit 13a0e5a

Browse files
committed
Rollup merge of rust-lang#22271 - steveklabnik:gh22035, r=nikomatsakis
Fixes rust-lang#22035.
2 parents 7813bbb + 58a7d58 commit 13a0e5a

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/doc/trpl/compound-data-types.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -263,15 +263,12 @@ let four_is_smaller = four <= ten;
263263
let four_equals_ten = four == ten;
264264
```
265265

266-
This may seem rather limiting, particularly equality being invalid; in
267-
many cases however, it's unnecessary. Rust provides the [`match`][match]
268-
keyword, which will be examined in more detail in the next section, which
269-
often allows better and easier branch control than a series of `if`/`else`
270-
statements would. However, for our [game][game] we need the comparisons
271-
to work so we will utilize the `Ordering` `enum` provided by the standard
272-
library which supports such comparisons. It has this form:
266+
This may seem rather limiting, but it's a limitation which we can overcome.
267+
There are two ways: by implementing equality ourselves, or by using the
268+
[`match`][match] keyword. We don't know enough about Rust to implement equality
269+
yet, but we can use the `Ordering` enum from the standard library, which does:
273270

274-
```{rust}
271+
```
275272
enum Ordering {
276273
Less,
277274
Equal,

0 commit comments

Comments
 (0)