Skip to content

Instantly share code, notes, and snippets.

@scottcarr
Created May 26, 2016 18:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scottcarr/19d93b3584eb3aea62d244ee5a5eb974 to your computer and use it in GitHub Desktop.
Save scottcarr/19d93b3584eb3aea62d244ee5a5eb974 to your computer and use it in GitHub Desktop.
#![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