From 96207be0678e331c16fde381f5fb8f6454e27d22 Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Wed, 30 Jan 2019 14:56:09 -0500 Subject: [PATCH] Add missing dereference --- .idea/workspace.xml | 52 ++++++++++++++++++--------------------------- enums/src/main.rs | 24 +++++++++++---------- 2 files changed, 34 insertions(+), 42 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 8a3748f..1de8081 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -1,9 +1,7 @@ - - - + - + @@ -122,7 +116,7 @@ - + + + - - + - @@ -212,8 +206,8 @@ - - + + @@ -221,7 +215,7 @@ - + @@ -352,12 +346,8 @@ - - - - - - + + diff --git a/enums/src/main.rs b/enums/src/main.rs index fb6ee8d..c48b276 100644 --- a/enums/src/main.rs +++ b/enums/src/main.rs @@ -28,26 +28,26 @@ enum UsState { Montana, Nebraska, Nevada, - New_Hampshire, - New_Jersey, - New_Mexico, - New_York, - North_Carolina, - North_Dakota, + NewHampshire, + NewJersey, + NewMexico, + NewYork, + NorthCarolina, + NorthDakota, Ohio, Oklahoma, Oregon, Pennsylvania, - Rhode_Island, - South_Carolina, - South_Dakota, + RhodeIsland, + SouthCarolina, + SouthDakota, Tennessee, Texas, Utah, Vermont, Virginia, Washington, - West_Virginia, + WestVirginia, Wisconsin, Wyoming, } @@ -79,7 +79,7 @@ fn count_non_quarters(count: &mut u32, coin: Coin) { if let Coin::Quarter(state) = coin { println!("State quarter from {:?}!", state); } else { - count += 1; + *count += 1; } } @@ -92,4 +92,6 @@ fn plus_one(x: Option) -> Option { fn main() { println!("Hello, world!"); + + println!("{}", value_in_cents(Coin::Quarter(UsState::Michigan))); }