1
0
mirror of https://github.com/jht5945/rust_util.git synced 2025-12-27 15:40:03 +08:00

feat: add opt_value!

This commit is contained in:
2020-11-15 22:13:15 +08:00
parent 6e821a4cd9
commit 6b4f7bf3ef
2 changed files with 6 additions and 1 deletions

View File

@@ -1,6 +1,6 @@
[package] [package]
name = "rust_util" name = "rust_util"
version = "0.6.16" version = "0.6.17"
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"

View File

@@ -34,6 +34,11 @@ pub mod util_net;
#[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! opt_value {
($e: expr) => {
match $e { Some(o) => o, None => return, }
}
}
pub type XResult<T> = Result<T, Box<dyn std::error::Error>>; pub type XResult<T> = Result<T, Box<dyn std::error::Error>>;