Skip to content

Commit

Permalink
Try using export
Browse files Browse the repository at this point in the history
  • Loading branch information
kjvalencik committed Jun 28, 2024
1 parent 2b8ac92 commit f8d6749
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions test/electron/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
use neon::prelude::*;

fn hello(mut cx: FunctionContext) -> JsResult<JsString> {
Ok(cx.string("Hello, World!"))
}

#[neon::main]
fn main(mut cx: ModuleContext) -> NeonResult<()> {
cx.export_function("hello", hello)?;

Ok(())
#[neon::export]
fn hello() -> &'static str {
"Hello, World!"
}

0 comments on commit f8d6749

Please sign in to comment.