Macro human_panic::setup_panic
source · [−]macro_rules! setup_panic {
($meta:expr) => { ... };
() => { ... };
}
Expand description
human-panic
initialisation macro
You can either call this macro with no arguments setup_panic!()
or
with a Metadata struct, if you don’t want the error message to display
the values used in your Cargo.toml
file.
The Metadata struct can’t implement Default
because of orphan rules, which
means you need to provide all fields for initialisation.
use human_panic::setup_panic;
setup_panic!(Metadata {
name: env!("CARGO_PKG_NAME").into(),
version: env!("CARGO_PKG_VERSION").into(),
authors: "My Company Support <support@mycompany.com>".into(),
homepage: "support.mycompany.com".into(),
});