maflow 0.1.0

Flow macros: basically unwrap for return, continue and break
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use maflow::*;

fn main () {
    let mut a = 0;
    for i in 0..10 {
        next!{if i == 2} // continue if ..
        hold!{if i == 5} // break if ..
        a += 1;
    }
    assert_eq!(a,4);
    assert!(func(Some(true)))
}

fn func (bo:Option<bool>) -> bool {
    exit!{is_true = bo} // return false if None
    is_true
}