Skip to content

Commit

Permalink
Update lib.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn committed Nov 23, 2020
1 parent d29f1d8 commit 27bdd49
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#[macro_use]
extern crate napi;
#[macro_use]
extern crate napi_derive;

use std::convert::TryInto;
Expand All @@ -15,8 +13,6 @@ static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
#[global_allocator]
static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc;

register_module!(example, init);

struct AsyncTask(u32);

impl Task for AsyncTask {
Expand All @@ -35,6 +31,7 @@ impl Task for AsyncTask {
}
}

#[module_exports]
fn init(module: &mut Module) -> Result<()> {
module.create_named_method("sync", sync_fn)?;

Expand Down

0 comments on commit 27bdd49

Please sign in to comment.