1 unstable release
0.1.0 | Feb 24, 2021 |
---|
#73 in #return
141 downloads per month
4KB
exit_status
Simple proc-macro for enabling rust main function to return an exit status code.
Example
#[exit_status::main]
fn main() -> anyhow::Result<i32> {
Ok(0)
}
// expands to
// fn main() -> anyhow::Result<()> {
// fn inner_main() -> anyhow::Result<i32> {
// {
// Ok(0)
// }
// }
// std::process::exit(inner_main()?);
// }
Dependencies
~1.5MB
~37K SLoC