22 lines
444 B
Rust
22 lines
444 B
Rust
macro_rules! api_err {
|
|
( $resp:ident, $($arg:tt)* ) => {
|
|
APIError::$resp(
|
|
Json($crate::yui::ErrorResponse {
|
|
error: format!( $($arg)* ),
|
|
}))
|
|
};
|
|
}
|
|
|
|
macro_rules! hex {
|
|
($arg:expr) => {{
|
|
$arg.map(|u| format!("{:x}", u))
|
|
.collect::<Vec<String>>()
|
|
.into_iter()
|
|
.as_slice()
|
|
.join("")
|
|
}};
|
|
}
|
|
|
|
pub(crate) use api_err;
|
|
pub(crate) use hex;
|