From 72aede790bfef4673b8bcf58bc5f098c0da65325 Mon Sep 17 00:00:00 2001 From: Jonas Hietala Date: Sat, 26 Jul 2014 10:54:00 +0200 Subject: [PATCH] Guide: Derive equal to avoid compile error. --- src/doc/guide.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/doc/guide.md b/src/doc/guide.md index 387841ab3fcef..a889e4233b7ce 100644 --- a/src/doc/guide.md +++ b/src/doc/guide.md @@ -1066,6 +1066,7 @@ feature of Rust, and are used throughout the standard library. Enums look like this: ``` +#[deriving(Eq, PartialEq)] enum Ordering { Less, Equal, @@ -1073,6 +1074,9 @@ enum Ordering { } ``` +We will talk about `#[deriving(Eq, PartialEq)]` later, for now we can read +it as "allow us to use `==` for comparisons." + This is an enum that is provided by the Rust standard library. An `Ordering` can only be _one_ of `Less`, `Equal`, or `Greater` at any given time. Here's an example: