fix(doc): update readme code example

master
Ashley Williams 7 years ago
parent 3675083ac4
commit cf7fed3cbf
  1. 5
      README.md

@ -57,7 +57,7 @@ this project is written in rust. [get rust] to work on this project.
use wasm_bindgen::prelude::*; use wasm_bindgen::prelude::*;
``` ```
4. annotate your public functions with `#[wasm_bindgen]` and `#[no_mangle]`, for example: 4. annotate your public functions with `#[wasm_bindgen]`, for example:
```rust ```rust
#[wasm_bindgen] #[wasm_bindgen]
@ -66,8 +66,7 @@ this project is written in rust. [get rust] to work on this project.
} }
#[wasm_bindgen] #[wasm_bindgen]
#[no_mangle] pub fn greet(name: &str) {
pub extern fn greet(name: &str) {
alert(&format!("Hello, {}!", name)); alert(&format!("Hello, {}!", name));
} }
``` ```

Loading…
Cancel
Save