rustwasm / book

The Rust and WebAssembly Book
https://rustwasm.github.io/docs/book/
MIT License
1.75k stars 211 forks source link

Add #[wasm_bindgen] before impl Universe #164

Closed dcuenot closed 5 years ago

dcuenot commented 5 years ago

Summary

When I follow the 4.4 step I faced an issue due to the fact the wasm_bindgen was missing on the first sample.

So I proposed this small fix.

Thanks in advance for the merge

alexcrichton commented 5 years ago

Thanks for the PR and sorry for the delay! For private methods the #[wasm_bindgen] isn't needed, but if it contains public methods the block is needed. Since these examples are only showing private methods, I think it's fine to elide!