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

12 lines
277 B
Rust
Raw Normal View History

2023-07-20 04:17:05 +09:00
#[macro_export]
macro_rules! impl_into_napi_error {
($a:ty) => {
#[cfg(feature = "napi")]
impl Into<napi::Error> for $a {
fn into(self) -> napi::Error {
napi::Error::from_reason(self.to_string())
}
}
};
}