Make note that Ordering is builtin.
This way people won't try to copy/paste it in.
This commit is contained in:
parent
655600b01b
commit
d1e37399a2
@ -1073,10 +1073,10 @@ destructuring `let`.
|
|||||||
## Enums
|
## Enums
|
||||||
|
|
||||||
Finally, Rust has a "sum type", an **enum**. Enums are an incredibly useful
|
Finally, Rust has a "sum type", an **enum**. Enums are an incredibly useful
|
||||||
feature of Rust, and are used throughout the standard library. Enums look
|
feature of Rust, and are used throughout the standard library. This is an enum
|
||||||
like this:
|
that is provided by the Rust standard library:
|
||||||
|
|
||||||
```
|
```{rust}
|
||||||
enum Ordering {
|
enum Ordering {
|
||||||
Less,
|
Less,
|
||||||
Equal,
|
Equal,
|
||||||
@ -1084,9 +1084,8 @@ enum Ordering {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
This is an enum that is provided by the Rust standard library. An `Ordering`
|
An `Ordering` can only be _one_ of `Less`, `Equal`, or `Greater` at any given
|
||||||
can only be _one_ of `Less`, `Equal`, or `Greater` at any given time. Here's
|
time. Here's an example:
|
||||||
an example:
|
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
fn cmp(a: int, b: int) -> Ordering {
|
fn cmp(a: int, b: int) -> Ordering {
|
||||||
|
Loading…
Reference in New Issue
Block a user