macro_rules! cbtmap {
    ($key:expr => $value:expr; $($tokens: tt)+) => { ... };
}
Expand description

Build BTreeMap from collection iterator comprehensions.

Limitations

  • Only 3 nested comprehensions

Examples:

use sugars::cbtmap;

let a = 10;
let w = cbtmap!{x => x+a; x in 1..10};
let z = cbtmap!{x => x+a; x in 1..10, if x%2 == 0};