macro_rules! generator {
    ($($x:tt)*) => { ... };
}
Expand description

Create YieldIter with the provided generator body

Examples

#![feature(generators, generator_trait)]

use yield_iter::generator;

let x = 10;
let iter = generator! {
    let r = &x;

    for i in 0..5u32 {
        yield i * *r
    }
};