mirror of
https://github.com/jht5945/rust_util.git
synced 2025-12-30 00:50:05 +08:00
feat: add failure and exit
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "rust_util"
|
name = "rust_util"
|
||||||
version = "0.6.32"
|
version = "0.6.33"
|
||||||
authors = ["Hatter Jiang <jht5945@gmail.com>"]
|
authors = ["Hatter Jiang <jht5945@gmail.com>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
description = "Hatter's Rust Util"
|
description = "Hatter's Rust Util"
|
||||||
|
|||||||
@@ -40,6 +40,12 @@ pub mod util_tlv;
|
|||||||
#[macro_export] macro_rules! debugging {
|
#[macro_export] macro_rules! debugging {
|
||||||
($($arg:tt)+) => ( rust_util::util_msg::print_debug(&format!($($arg)+)); )
|
($($arg:tt)+) => ( rust_util::util_msg::print_debug(&format!($($arg)+)); )
|
||||||
}
|
}
|
||||||
|
#[macro_export] macro_rules! failure_and_exit {
|
||||||
|
($($arg:tt)+) => ( {
|
||||||
|
rust_util::util_msg::print_error(&format!($($arg)+));
|
||||||
|
std::process::exit(-1);
|
||||||
|
} )
|
||||||
|
}
|
||||||
#[macro_export] macro_rules! opt_value {
|
#[macro_export] macro_rules! opt_value {
|
||||||
($ex: expr) => ( match $ex { Some(o) => o, None => return, } )
|
($ex: expr) => ( match $ex { Some(o) => o, None => return, } )
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user