Skip to content

Commit

Permalink
Tweak docs
Browse files Browse the repository at this point in the history
Co-Authored-By: Liam Murphy <[email protected]>
  • Loading branch information
daxpedda and Liamolucko committed Apr 12, 2023
1 parent 82f87dc commit 072035b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions guide/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
- [`skip`](./reference/attributes/on-rust-exports/skip.md)
- [`skip_jsdoc`](./reference/attributes/on-rust-exports/skip_jsdoc.md)
- [`start`](./reference/attributes/on-rust-exports/start.md)
- [`main`](./reference/attributes/on-rust-exports/main.md)
- [`typescript_custom_section`](./reference/attributes/on-rust-exports/typescript_custom_section.md)
- [`getter` and `setter`](./reference/attributes/on-rust-exports/getter-and-setter.md)
- [`inspectable`](./reference/attributes/on-rust-exports/inspectable.md)
Expand Down
8 changes: 4 additions & 4 deletions guide/src/reference/attributes/on-rust-exports/main.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ async fn main() {
}
```

This attribute is intended to be used on the `main` function of binaries or
examples only. Unlike `#[wasm_bindgen(start)]`, it will not cause a function to
be executed on start in a library.
This attribute is only intended to be used on the `main` function of binaries or
examples. Unlike `#[wasm_bindgen(start)]`, it will not cause an arbitrary
function to be executed on start in a library.

The return type support is modeled after [`Termination`]. `()` and `Infallible`
are supported, but [`Termination`] itself is not. In order, wasm-bindgen will
first detect a `Result<(), impl Into<JsValue>>` and will throw proper
`JsValue`s, `Result<(), impl Debug>` will convert an error to a string and throw
that.

[`termination`]: https://doc.rust-lang.org/std/process/trait.Termination.html
[`Termination`]: https://doc.rust-lang.org/std/process/trait.Termination.html

0 comments on commit 072035b

Please sign in to comment.