docs: wrong language attr in Taste section

This commit is contained in:
LongYinan 2020-04-30 18:58:29 +08:00
parent ea50a0c130
commit 53c173d6f9
No known key found for this signature in database
GPG key ID: A3FFE134A3E20881

View file

@ -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()?;