ct-for 0.1.1

macro to repeat code multiple times with different substitutions
Documentation
  • Coverage
  • 50%
    1 out of 2 items documented1 out of 1 items with examples
  • Size
  • Source code size: 8.66 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 255.53 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 5s Average build duration of successful builds.
  • all releases: 5s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Rob2309/ct-for-rs
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Rob2309

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.