From 86c166eece86194e5e89f77e92d364df11324aef Mon Sep 17 00:00:00 2001 From: LongYinan Date: Mon, 27 Apr 2020 10:35:48 +0800 Subject: [PATCH] doc: fix example --- napi-derive-example/src/lib.rs | 2 +- napi-derive/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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))