Crates.io | final_fn |
lib.rs | final_fn |
version | 0.1.0 |
source | src |
created_at | 2023-03-04 16:00:16.565398 |
updated_at | 2023-03-04 16:00:16.565398 |
description | Simple final_fn macro, what executes given code when leaving code block |
homepage | |
repository | |
max_upload_size | |
id | 800706 |
size | 11,973 |
This crate provides final_fn macro, what executes given code when leaving code block.
use final_fn::final_fn;
fn main() {
final_fn!(
println!("End of main!")
);
println!("Hello world!");
}
You can also pass variables
use final_fn::final_fn;
fn main() {
let x = 56;
final_fn(
println!("{x}")
);
println!("Hello world");
}