Module wyz::exit

source ·
Expand description

exit! macro

The exit! macro simplifies exiting with an error code, and optionally printing an error message prior to exit.

Examples

This example exits with status 1.

wyz::exit!();

This example exits with status 2.

wyz::exit!(2);

This example exits with status 3, and uses eprintln! to print an error message before exiting. Note that if stderr has been closed, this will crash the program with a panic due to SIGPIPE, and not call process::exit().

wyz::exit!(3, "Error status: {}", "testing");

!