Skip to main content

to_exit_code

Function to_exit_code 

Source
pub const fn to_exit_code(code: i32) -> ExitCode
Expand description

Convert an exit code constant to std::process::ExitCode.

This is useful for returning from main() with the correct exit code.

§Example

use dcg::exit_codes::{to_exit_code, EXIT_DENIED};

fn main() -> std::process::ExitCode {
    to_exit_code(EXIT_DENIED)
}