From b32aab82db30813ab9b37f17ca05a48d1f39d0e1 Mon Sep 17 00:00:00 2001 From: travis-update-bot Date: Mon, 22 Feb 2016 06:32:10 +0000 Subject: [PATCH] Update blog to 75aa669cdbb427c7bf0485c68692d243065cd3e9 --- _posts/2015-10-23-printing-to-screen.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/_posts/2015-10-23-printing-to-screen.md b/_posts/2015-10-23-printing-to-screen.md index f0791d94..53ec89e0 100644 --- a/_posts/2015-10-23-printing-to-screen.md +++ b/_posts/2015-10-23-printing-to-screen.md @@ -58,6 +58,7 @@ All of the code below goes into our new module (unless specified otherwise). First, we represent the different colors using an enum: ```rust +#[allow(dead_code)] #[repr(u8)] pub enum Color { Black = 0, @@ -82,6 +83,8 @@ We use a [C-like enum] here to explicitly specify the number for each color. Bec [C-like enum]: http://rustbyexample.com/custom_types/enum/c_like.html +Normally the compiler would issue a warning for each unused variant. By using the `#[allow(dead_code)]` attribute we disable these warnings for the `Color` enum. + To represent a full color code that specifies foreground and background color, we create a [newtype] on top of `u8`: [newtype]: https://aturon.github.io/features/types/newtype.html