diff --git a/napi-derive-example/src/lib.rs b/napi-derive-example/src/lib.rs index 39ca3fac..d5755677 100644 --- a/napi-derive-example/src/lib.rs +++ b/napi-derive-example/src/lib.rs @@ -23,7 +23,7 @@ fn test_throw<'a>(_ctx: CallContext) -> Result> { Err(Error::new(Status::GenericFailure)) } -#[js_function] +#[js_function(1)] fn fibonacci<'env>(ctx: CallContext<'env>) -> Result> { let n = ctx.get::(0)?.try_into()?; ctx.env.create_int64(fibonacci_native(n)) diff --git a/napi-derive/README.md b/napi-derive/README.md index f42959e5..e8be009b 100644 --- a/napi-derive/README.md +++ b/napi-derive/README.md @@ -9,7 +9,7 @@ extern crate napi_rs_derive; use napi_rs::{Result, Value, CallContext, Number}; use std::convert::TryInto; -#[js_function] +#[js_function(1)] fn fibonacci<'env>(ctx: CallContext<'env>) -> Result> { let n = ctx.get::(0)?.try_into()?; ctx.env.create_int64(fibonacci_native(n))