docs: wrong language attr in Taste section
This commit is contained in:
parent
ea50a0c130
commit
53c173d6f9
1 changed files with 1 additions and 1 deletions
|
@ -27,7 +27,7 @@ This library depends on N-API and requires Node 8.9 or later. It is still pretty
|
||||||
One nice feature is that this crate allows you to build add-ons purely with the Rust toolchain and without involving `node-gyp`.
|
One nice feature is that this crate allows you to build add-ons purely with the Rust toolchain and without involving `node-gyp`.
|
||||||
|
|
||||||
## Taste
|
## Taste
|
||||||
```rs
|
```rust
|
||||||
#[js_function(1)] // ------> argument length, omit for zero
|
#[js_function(1)] // ------> argument length, omit for zero
|
||||||
fn fibonacci<'env>(ctx: CallContext<'env>) -> Result<Value<'env, Number>> {
|
fn fibonacci<'env>(ctx: CallContext<'env>) -> Result<Value<'env, Number>> {
|
||||||
let n = ctx.get::<Number>(0)?.try_into()?;
|
let n = ctx.get::<Number>(0)?.try_into()?;
|
||||||
|
|
Loading…
Reference in a new issue