fix(napi): missing declaration in register_module macro

This commit is contained in:
LongYinan 2020-07-14 23:52:42 +08:00
parent 3f2b6c230e
commit cce5f1fe00
No known key found for this signature in database
GPG key ID: C3666B7FC82ADAD7

View file

@ -101,7 +101,9 @@ pub use tokio_rt::shutdown as shutdown_tokio_rt;
macro_rules! register_module { macro_rules! register_module {
($module_name:ident, $init:ident) => { ($module_name:ident, $init:ident) => {
#[inline] #[inline]
#[cfg(all(feature = "tokio_rt", napi4))]
fn check_status(code: $crate::sys::napi_status) -> Result<()> { fn check_status(code: $crate::sys::napi_status) -> Result<()> {
use $crate::{Error, Status};
let status = Status::from(code); let status = Status::from(code);
match status { match status {
Status::Ok => Ok(()), Status::Ok => Ok(()),