shower 0.1.0

get string of code block
Documentation
  • Coverage
  • 0%
    0 out of 2 items documented0 out of 1 items with examples
  • Size
  • Source code size: 4.32 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 270.67 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
  • tiby312/shower
    0 0 1
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • tiby312

Get the source code of a code block as a static string.

Example

fn main() {
    let (k, src) = shower::source!(|| {
        for i in 0..5 {
            println!("{}", i);
        }
        "{abc}"
    });

    // print the source code of the program
    println!("{}", src);

    println!("running program:");
    let k = k();

    println!("program returned={}", k);

}

Output

shower::source!(|| {
    for i in 0..5 {
        println!("{}", i);
    }
    "{abc}"
})
running program:
0
1
2
3
4
program returned={abc}