mirror of
https://github.com/jht5945/rust_util.git
synced 2025-12-29 08:30:04 +08:00
add time, iff!
This commit is contained in:
@@ -13,6 +13,15 @@ pub mod util_cmd;
|
||||
pub mod util_msg;
|
||||
pub mod util_size;
|
||||
pub mod util_file;
|
||||
pub mod util_time;
|
||||
|
||||
/// iff!(condition, result_when_true, result_when_false)
|
||||
#[macro_export]
|
||||
macro_rules! iff {
|
||||
($c:expr, $t:expr, $f:expr) => {
|
||||
if $c { $t } else { $f }
|
||||
};
|
||||
}
|
||||
|
||||
pub type XResult<T> = Result<T, Box<dyn std::error::Error>>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user