firefish/packages/backend-rs/src/macros.rs

11 lines
252 B
Rust
Raw Normal View History

2023-07-20 04:17:05 +09:00
#[macro_export]
macro_rules! impl_napi_error_from {
2023-07-20 04:17:05 +09:00
($a:ty) => {
impl From<$a> for napi::Error {
fn from(reason: $a) -> napi::Error {
napi::Error::from_reason(reason.to_string())
2023-07-20 04:17:05 +09:00
}
}
};
}