ct-for

Crates.ioct-for
lib.rsct-for
version0.1.1
sourcesrc
created_at2022-02-16 10:06:53.914597
updated_at2022-02-16 10:11:19.580229
descriptionmacro to repeat code multiple times with different substitutions
homepage
repositoryhttps://github.com/rob2309/ct-for-rs
max_upload_size
id533241
size9,131
Robin Quint (Rob2309)

documentation

README

ct-for

license crates.io ci docs.rs

This crate exposes the ct-for!() macro, which can be used to repeat code n times with a substitution.

For example:

let c = 17;
ct_for!(x in ["5", 6, c, vec![5, 6, 7]] do
    println!("{:?}", x);
);

expands to:

let c = 17;
println!("{:?}", "5");
println!("{:?}", 6);
println!("{:?}", c);
println!("{:?}", vec![5, 6, 7]);

The ct_for!() macro can also be nested.

There really isn't much more to it.

Commit count: 6

cargo fmt