Created
July 22, 2017 02:41
-
-
Save itang/eef0e2dc35a482d456e1632a0e699af1 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
#[macro_use] | |
extern crate comp; | |
fn main() { | |
println!("Hello, world!"); | |
let iter = iter! { | |
let x <- 0..2u8; | |
let y <- vec!['a', 'b']; | |
(x, y) | |
}; | |
for x in iter { | |
println!("{:?}", x); | |
} | |
let option = option! { | |
let a <- Some(1); | |
let b <- None::<u32>; | |
a + b | |
}; | |
println!("{:?}", option); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment