Skip to content

Instantly share code, notes, and snippets.

@itang
Created July 22, 2017 02:41
Show Gist options
  • Save itang/eef0e2dc35a482d456e1632a0e699af1 to your computer and use it in GitHub Desktop.
Save itang/eef0e2dc35a482d456e1632a0e699af1 to your computer and use it in GitHub Desktop.
#[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