Skip to content

tiby312/shower

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages