Crates.io | shower |
lib.rs | shower |
version | 0.1.0 |
source | src |
created_at | 2023-07-01 15:49:45.638431 |
updated_at | 2023-07-01 15:49:45.638431 |
description | get string of code block |
homepage | |
repository | https://github.com/tiby312/shower |
max_upload_size | |
id | 905585 |
size | 4,825 |
Get the source code of a code block as a static string.
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);
}
shower::source!(|| {
for i in 0..5 {
println!("{}", i);
}
"{abc}"
})
running program:
0
1
2
3
4
program returned={abc}