Created
May 26, 2016 18:45
-
-
Save scottcarr/19d93b3584eb3aea62d244ee5a5eb974 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![allow(dead_code)] | |
use self::Example::*; | |
enum Example { | |
A, | |
B, | |
C, | |
D, | |
E, | |
F, | |
G, | |
} | |
fn compare(ex1: Example, b: bool) -> bool { | |
match ex1 { | |
A if b => true, | |
A if !b => true, | |
B => true, | |
C => true, | |
D => true, | |
E => true, | |
F => true, | |
G => false, | |
} | |
} | |
fn main() { | |
compare(A, false); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment