From bfe644fe13ee84b190345c53d419a0919a4a946f Mon Sep 17 00:00:00 2001 From: kazuhiko kikuchi Date: Wed, 11 Oct 2023 16:40:58 +0900 Subject: [PATCH] rename main -> start on `wasm-bindgen(start)` example (#3648) --- guide/src/reference/attributes/on-rust-exports/start.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/guide/src/reference/attributes/on-rust-exports/start.md b/guide/src/reference/attributes/on-rust-exports/start.md index 83bd7f4ae04..b3b583cb5f2 100644 --- a/guide/src/reference/attributes/on-rust-exports/start.md +++ b/guide/src/reference/attributes/on-rust-exports/start.md @@ -1,20 +1,20 @@ # `start` -When attached to a `pub` function this attribute will configure the `start` +When attached to a function this attribute will configure the `start` section of the wasm executable to be emitted, executing the tagged function as soon as the wasm module is instantiated. ```rust #[wasm_bindgen(start)] -fn main() { +fn start() { // executed automatically ... } ``` The `start` section of the wasm executable will be configured to execute the -`main` function here as soon as it can. Note that due to various practical +`start` function here as soon as it can. Note that due to various practical limitations today the start section of the executable may not literally point to -`main`, but the `main` function here should be started up automatically when the +`start`, but the `start` function here should be started up automatically when the wasm module is loaded. There's a few caveats to be aware of when using the `start` attribute: