final_fn 0.1.0

Simple final_fn macro, what executes given code when leaving code block
Documentation
  • Coverage
  • 66.67%
    2 out of 3 items documented2 out of 3 items with examples
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Blinc13

final-fn

This crate provides final_fn macro, what executes given code when leaving code block.

Examples

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");
}