From c88a73688d9d181a197b818d44ebeee8d9aa1855 Mon Sep 17 00:00:00 2001 From: "Carol (Nichols || Goulding)" Date: Mon, 22 Aug 2016 12:17:00 -0400 Subject: [PATCH] Add missing derive debug Fixes #171. --- src/ch06-02-match.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ch06-02-match.md b/src/ch06-02-match.md index 6284a4632..32d8330c3 100644 --- a/src/ch06-02-match.md +++ b/src/ch06-02-match.md @@ -94,6 +94,7 @@ can add this information to our `enum` by changing the `Quarter` variant to have a `State` value: ```rust +#[derive(Debug)] // So we can inspect the state in a minute enum UsState { Alabama, Alaska, @@ -150,7 +151,8 @@ be `Coin::Quarter(UsState::Alaska)`. When we compare that value with each of the match arms, none of them match until we reach `Coin::Quarter(state)`. At that point, the binding for `state` will be the value `UsState::Alaska`. We can then use that binding in the `println!`, thus getting the inner state value out of -the `Coin` enum variant for `Quarter`. +the `Coin` enum variant for `Quarter` and enabling us to print "State quarter +from Alaska!". Remember the `Option` type from the previous section, and that we wanted to be able to get the inner `T` value out of the `Some` case? This will be very