pub trait UnwrapOrExit<T> {
// Required method
fn unwrap_or_exit(self) -> T;
}Expand description
Extension trait for converting Result<GenerateOutput, BuildErrors> into
a direct output with process::exit(1) on error.
Provides a drop-in migration path from the old generate_icons() API
that called process::exit internally.
§Example
use native_theme_build::UnwrapOrExit;
native_theme_build::generate_icons("icons/icons.toml")
.unwrap_or_exit()
.emit_cargo_directives()
.expect("failed to write generated code");Required Methods§
Sourcefn unwrap_or_exit(self) -> T
fn unwrap_or_exit(self) -> T
Unwrap the Ok value or emit cargo errors and exit the process.