From f8d6749216e545ca8286375617c8aaa75b569a5c Mon Sep 17 00:00:00 2001 From: "K.J. Valencik" Date: Fri, 28 Jun 2024 14:12:19 -0400 Subject: [PATCH] Try using export --- test/electron/src/lib.rs | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/test/electron/src/lib.rs b/test/electron/src/lib.rs index e87ce9755..e7b9d04c2 100644 --- a/test/electron/src/lib.rs +++ b/test/electron/src/lib.rs @@ -1,12 +1,4 @@ -use neon::prelude::*; - -fn hello(mut cx: FunctionContext) -> JsResult { - 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!" }