postfix-macros 0.1.0

Postfix macros on stable Rust, today
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use postfix_macros::{postfix_macros, unwrap_or};

fn main() {
	postfix_macros! {
		let urls = ["https://rust-lang.org", "http://github.com"];
		for url in urls.iter() {
			let mut url_splitter = url.splitn(2, ':');
			let scheme = url_splitter.next().unwrap();
			let _remainder = url_splitter.next().unwrap_or! {
				println!("Ignoring URL: No scheme found");
				continue;
			};
			println!("scheme is {}", scheme);
		}
	}
}