Last active
September 28, 2016 21:06
-
-
Save chrivers/d78f29668f962ea2eba3ddd5b1f9d6e8 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
use num::ToPrimitive; | |
macro_rules! enum_to_primitive { | |
($name:ident) => { | |
impl ToPrimitive for $name { | |
fn to_i64(&self) -> Option<i64> { | |
return Some(*self as i64); | |
} | |
fn to_u64(&self) -> Option<u64> { | |
return Some(*self as u64); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment