loop-code 0.5.2

Code repeating macro
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use loop_code::repeat;

fn main() {
    let mut a = [5, 3, 1, 3];
    println!("{:?}", a);

    let b = [5, 2, 15, 0];

    repeat!(I /* You can type in here a variable type, but default type is usize */ 4 {
        a[I] += b[I];
    });

    println!("{:?}", a);
}