firefish/packages/backend/native-utils/src/macros.rs
naskya 93b7396990
refactor: make database models accesible to napi
Co-authored-by: sup39 <dev@sup39.dev>
2024-01-20 05:57:00 +09:00

11 lines
285 B
Rust

#[macro_export]
macro_rules! impl_napi_error_from {
($a:ty) => {
#[cfg(feature = "napi")]
impl From<$a> for napi::Error {
fn from(reason: $a) -> napi::Error {
napi::Error::from_reason(reason.to_string())
}
}
};
}