Last active
September 30, 2016 15:56
-
-
Save osa1/aa6f055106b167bafaad417d26b587a7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| mod macros; | |
| #[macro_use] | |
| pub mod reply; | |
| #[cfg(test)] | |
| mod tests { | |
| #[test] | |
| fn it_works() { | |
| } | |
| } |
This file contains hidden or 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
| macro_rules! try_opt { | |
| ($e:expr) =>( | |
| match $e { | |
| Some(v) => v, | |
| None => return None, | |
| } | |
| ) | |
| } |
This file contains hidden or 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 macros; | |
| fn test() { | |
| try_opt!(None) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment